Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

=+nk so that p( B(k)) Answered: 1 week ago

Answered: 1 week ago

Question

Develop clear policy statements.

Answered: 1 week ago

Question

Draft a business plan.

Answered: 1 week ago

Question

Describe the guidelines for appropriate use of the direct plan.

Answered: 1 week ago