Question: I need a solution for project 4 which is a continuation for project 3 and I can only use if else statement or while so

I need a solution for project 4 which is a continuation for project 3 and I can only use if else statement or while so please don't use any case statements and there is also some of the lecture notes that might be helpful and the code for project 3 is attached as well.

I need a solution for project 4 which is a continuation forproject 3 and I can only use if else statement or whileso please don't use any case statements and there is also someof the lecture notes that might be helpful and the code forproject 3 is attached as well. 23 24 25 26 27 2829 30 // loop while sentinel value not yet read from userwhile ( grade != -1 ) { total = total + grade;// add grade to total counter = counter + 1; // increment

23 24 25 26 27 28 29 30 // loop while sentinel value not yet read from user while ( grade != -1 ) { total = total + grade; // add grade to total counter = counter + 1; // increment counter // get next grade from user printf( "%s'. "Enter grade. scanf("%d". &grade); // read // prompt for input next grade )/end while 32 // termination phase // if user entered at least one grade 35 if counter0) 36 37 38 39 40 calculate average of al1 grades entered average = ( float ) total / counter; // avoid truncation // display average with two digits of precision printf( "Class average is 2mn, end if n", average 42 43 else // if no grades were entered, output message puts( "No grades were entered" 45 46 )end else // end function main

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!