Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help Part 1: Simple Grade Book, Version 1.1 Modify the grade book code from Unit 3 so that it uses heap memory to store

Please help

Part 1: Simple Grade Book, Version 1.1

Modify the grade book code from Unit 3 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.

Part 2: Simple Grade Book, Version 2.0

Modify the grade book code from Unit 3 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. Orginial Code is below:

#include int main(void) { int arr[100]; //initialize array// int i=0, j=0, n=0; //initaliz variables// while(n != -1) //infinite loop which will stop when user enters -1// { printf("Enter percentage grade (0-100). Enter -1 to stop:"); scanf("%d", &n); //prints message and reads the grade// if(n != -1) //condition if user enter a grade that not -1// { arr[i ++] = n; //saves to array// } else { //condition if user enter a -1, then the loop will stop// } } printf(" The grades are: "); for (j = 0; j

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

ISBN: B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

post the closing entries to income summary and retained Earnings

Answered: 1 week ago