Question: I need help with C programming: The code is below and I need two seperate modifications, one for part 1 and one for part 2.

I need help with C programming: The code is below and I need two seperate modifications, one for part 1 and one for part 2. I appreciate it.

Part 1: Simple Grade Book

Modify the code from I have posted so that it uses heap memory to store percentage grades in the range from 0 to 100 (inclusive). The program should allow the user to indicate when he or she is done entering grades (since the user may not have grades to fill the whole array). When the user is done entering grades, the program should print out the grades entered by the user. Be sure to free the heap memory before the program ends. Please comment the code so I can understand the processes and functions.

Since I need to understant this, Please write out in plain English what the program needs to do and describe the steps in the process to solve the problem. Focus on a clear explanation of the process of solving the problem, not writing C. While it is a good idea to do this for both programs, you only need to discuss one in this post.

Part 2: Simple Grade Book,

Modify the code so that it uses 3 custom functions to calculate the average grade (arithmetic mean, not letter grade), report the highest grade, and find the lowest grade entered. This version of the program does not need to use heap memory, though you are welcome to do so. The program should allow the user to indicate when he or she is done entering grades (since the user may not have grades to fill the whole array). When the user is done entering grades, the program should print out the grades entered by the user. The program should also display the average grade, highest grade, and lowest grade.

Be sure to include extended comments to explain the roles of your custom functions.

Code:

#include //declare a max grade count constant

#define MAX_GRADE_COUNT 100

int main(void){ //declare an array called grade as integers int grade[MAX_GRADE_COUNT]; int i; //loop variable //declare an int for count int count = 0; char continueResponse; //for loop used since we do not know how many grades //increment i each time for(i = 0; i < MAX_GRADE_COUNT; i++){ //aak user to enter grade printf("Enter grade (0-100): "); //scan as an array using loop with number of index scanf("%d", &grade[i]); //count number of entries count++; //asks user if tehy want to continue enter grades printf("Continue entering grades? (Y/N): "); scanf(" %c", &continueResponse); if(continueResponse == 'N'||continueResponse == 'n'){ printf(" == End of Grade Entry == "); //gets out of for loop early break; } }//end of the for loop //print the grades output printf("Grades Entered are: "); //output loop is for loop using count of less than for(i = 0; i < count; i++){ //print printf("%3d ", grade[i]); } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!