CS 46 - C Programming Write a program to manipulate an array that contains a max
ID: 3621827 • Letter: C
Question
CS 46 - C ProgrammingWrite a program to manipulate an array that contains a maximum of 100 grade scores. Each grade is stored as type double. Global variables are not allowed, and all references to the grades array (outside of main() ) must use pointer notation. You must write 6 functions described below:
main()
defines the array
calls the other 5 functions listed below within a do while loop
menu() - displays 5 choices (1=get grades, 2=show grades, 3=change, 4-find, 5=quit).
getgrades() - this function enters grades into the array
received the array as an argument
within a loop:
prompts for a grade, or 0 to quit
gets a grade until 0 is entered
returns the count of how many grades were entered
showgrades() - this function displays all the grades and positions
receives the array and count
displays all the grades entered with position 0 shown as position 1.
Position Grade
1 96
2 88
3 74
4 91
etc.
changegrade() - this function allows changes to any grade
receives the array and count
prompts for element position of grade or 0 if no changes
(use position 1 as element 0).
prompts for new grade and updates array
findgrades() - this function displays a list of the grades within a range of grade values (low to high, e.g. if you wanted all students that received a B, enter 80 for low and 89 for high). Note: it is not necessary to sort the array of grades to do this.
receives the array and count
prompts for the lowest grade to locate
prompts for the highest grade to locate
displays all grades within (inclusive) the range low to high