Question: The sort and search Assignment Outcome: Student will demonstrate the ability to create and populate an array Student will demonstrate the ability to pass an
The sort and search Assignment
Outcome:
Student will demonstrate the ability to create and populate an array
Student will demonstrate the ability to pass an array to and from a function
Student will demonstrate the ability to sort and search an array
Student will demonstrate the ability to control the arrays size and effective size
Student will demonstrate the ability to use an array of values in math formulas
Program Specifications:
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.
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.
Display Average of all GPAs
If this is selected, the program will display the average of the values within the array. If new values have been entered, then the program will not display the average, instead it will message the user to enter values first.
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.
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.
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.
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.
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.
Quit
YOU CANNOT:
Use global variables
Use the word goto
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
