Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C #include Prompt the user to enter 5 floating point numbers, the numbers being test scores in the range 0.0 to 100.0 You need

In C

#include

Prompt the user to enter 5 floating point numbers, the numbers being test scores in the range 0.0 to 100.0

You need to validate the user's input for this exercise. If the user enters a number outside the legal range, print the message "Invalid Input" and prompt the user again for a valid number. [NOTE: You do not need to test for character input.]

Store the numbers in an array of doubles. Output the numbers on one line, each number followed by a comma (except the last number).

Also output: - the total number of points - the average of the array elements - the value of the maximum array element - the value of the minimum array element

Sample Output: Enter Score 1: 36.0 Enter Score 2: -1000 Invalid Input Enter Score 2: 89.5 Enter Score 3: 42.0 Enter Score 4: 66.3 Enter Score 5: 93.0

You entered: 36.000000, 89.500000, 42.000000, 66.300000, 93.000000

Total Score: 326.800000 Average Score: 65.360000 Max Score: 93.000000 Min Score: 36.000000

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

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

Which persons umbrella is this?

Answered: 1 week ago

Question

Have you given John and Nancy a list of parts?

Answered: 1 week ago