Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c program visual studio preferred ! 1 for finishing comment header (this will be checked by a grader) Description This signment is to write a

image text in transcribed
c program visual studio preferred !
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

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

Students also viewed these Databases questions

Question

Please help me evaluate this integral. 8 2 2 v - v

Answered: 1 week ago

Question

b. Why were these values considered important?

Answered: 1 week ago