Question: c program visual studio preferred ! 1 for finishing comment header (this will be checked by a grader) Description This signment is to write a
1 for finishing comment header (this will be checked by a grader) Description This signment is to write a program to read an unknown number of scores (double type) from the keyboard and calculate the sum and average (mean) of the scores. The program will repeatedly read positive scores until it reads a non-positive number, such as 0 or negative values. After reading a non-positive score, the program should output the sum and the average to the screen to an accuracy of 2 decimal places. Make sure the last input will not be part of the result. For example, if the user enters - 12 to quit (as below), then -12 should not be part of the calculation. You don't need to use an array to store all of the scores (we haven't learned about arrays yet, but most importantly, it is not necessary). Use variables to store the sum and number of scores you read and calculate the average after the user enters the non-positive value. Enter a positive score (0 or negative to quit): 90.1 Enter a positive score (0 or negative to quit): 92 Enter a positive score (0 or negative to quit): 93.5 Enter a positive score (0 or negative to quit): -12 The sum is: 275.60, average is: 91.87 If no valid input is entered at all, then output "No sum and average calculated!" before exiting the program. Enter a positive score (0 or negative to quit) -12 No sum and average calculated ! at the top of your program, you should have a comment section that follows the below format
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
