Question: This Program is to be done in C++ Problem 2 - Ordering of three numbers (10 points) Write a program that reads three doubles from

 This Program is to be done in C++ Problem 2 -

This Program is to be done in C++

Problem 2 - Ordering of three numbers (10 points) Write a program that reads three doubles from the user and displays the values in ascending order (that is, smallest then largest). Your program should check whether the user entered the same number twice If the user did enter the same number twice, then your program should give an error message and ask the user to enter another number. If the user entered the same number again, then the program should give an error message and quit without ordering the numbers HINT: Try to determine the order of the numbers as they are being entered Consider the case that the user enters the same number twice but not consecutively Keep a counter that tracks the number of times the user provided incorrect input. For example, your program should behave as follows (user input is underlined) Input: 0.4 Input: -4.5 Input: 0.4 Print an error message and ask for another input Input: 6.9 Output: -4.5 0.4 6.9 Input: 13 Input: 1.3 Print an error message and ask for another input Input: 89.5 Input: -0.6 Output: -0.6 1.3 89.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!