Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

What were your actions? Your thoughts? Your feelings?

Answered: 1 week ago