Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

C programming Help  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hello everyone I was wondering if you could help me with something that I am currently stuck on.  Do you know how I could complete the following assignment? thanks
Could you use C programming only? I really appreciate it.

You are to write a WELL written C program that uses the menu above.  All your code will be written using functions.  Main will only have a menu system and a switch.  Main will call all other functions.  The program needs to allow for about 1000 or so GPAs or just some number, you pick, it should work with any reasonable size.
A. Enter GPA:
If this is selected, the user will then enter a signal value for his or her GPA (example 3.55).  Remember you cannot exceed the SIZE of the array.  If a GPA below 2.0 is entered: Display the following message: You need to study harder.  If GPA is above 3.5 Display the following message: Nice work.
B. Display Average of all GPA’s
If this is selected, the program will display the average of the values within the array.  If now values have been entered, then the program will not display the average, instead it will message the user to enter values first.
C. Display Highest GPA
If this is selected, you should call a bubble sort routine, sort the array and display the value located at either array[0] or array[SIZE -1] depending on if you sorted it in ascending or descending order. Finally, if no values have been entered, the program will notify the user to enter values first.
D. Display Lowest GPA
If this is selected, you should call a bubble sort routine, sort the array and display the value located at either array[0] or array[SIZE -1] depending on if you sorted it in ascending or descending order. Finally, if no values have been entered, the program will notify the user to enter values first.
E. Display the adjusted average
If this is selected, the program will show the average of all the values in the array except for the lowest GPA value.  In other words, it drops the lowest value and averages the rest.  Keep in mind, that you cannot drop the lowest should you only have one value.  Finally, if no values have been entered, the program will notify the user to enter values first.
F. See if a certain GPA was entered
The program will ask the user to enter any GPA value.  Then the program will search the array for the first occurrence of that value.  If the value is not found, the program will inform the user that the GPA was never entered.  If the value was found, then the program would say that the value was found at the xx location in the array.  For example, The GPA 3.55 the fifth value of the array. Finally, if no values have been entered, the program will notify the user to enter values first.
G. Display the Contents of the Array
If this is selected the array will be sorted in ascending order and the all values will be echoed to the screen.
Q. Quit
 
Ranch Hand
Posts: 505
Chrome Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch!

What are you having trouble with?  If you didn't have a computer and this was your job, how would you do it manually?

You really need a good idea of how to solve the problem before writing your first line of code.
 
lowercase baba
Posts: 12734
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nobody here is going to do this for you.  1) you wouldn't learn anything. 2)  it would be unethical.  3)  it's probably a violation of your school's or business' code of ethics.

What we WILL do is help you write it.  Show us what you have.  We'll make suggestions and guide to to writing it yourself.
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!