Program 1 - Range of a set of numbers numbersFor this program, you need to read in 3 numbers, order the numbers in ascending order, and calculate thedifference between the largest and smallest number...

Program 1 - Range of a set of numbers numbersFor this program, you need to read in 3 numbers, order the numbers in ascending order, and calculate thedifference between the largest and smallest number entered. Call this filerange.cpp1. Prompt the user and read in 3 numbers. Store them in 3 variables. (8 points)2. If the user entered the same number 3 times, print an error message and exit. (7 points)3. Useif ...elsestatements, in whatever combination required, to print the numbers out in ascendingorder. (25 points)4. Print the difference between the largest and smallest number. (5 points)5. Add comments wherever appropriate to explain your logic. (5 points)6. You can assume that the user will only enter the proper type of data for the 3 numbers. No typechecking required.Sample RunsThe underlinedtext is the user input.
Sample Run 1Enter 3 numbers:1725.817The numbers in order are : 17 17 25.8The range is 8.8Sample Run 2Enter 3 numbers:-8.540.2712.9The numbers in order are : -8.5 12.9 40.27The range is 48.77Sample Run 3Enter 3 numbers:34.234.234.2You entered the same number three times. Exiting.
Sep 24, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here