Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a C++ code that asks the user to enter two decimal numbers to be compared. exmaple: Enter the FIRST number to compare: Enter

I need a C++ code that asks the user to enter two decimal numbers to be compared. exmaple:

Enter the FIRST number to compare:

Enter the SECOND number to compare:

The program then proceeds to compare the numbers, and decide on which of the following three messages to display on screen:

The first number is EQUAL to the second number.

The first number is GREATER than the second number.

The first number is LESS than the second number.

Finally, the program should ask the user:

Do you want to compare numbers again? (Y/N)

The user then presses a key. If the user enters Y, the program should start over asking for new numbers and making another comparison. If the user enters N, the program should exit. On the other hand, if the user enters any other key, the program should insist in asking the above question until the user presses either Y or N. Uppercase and lowercase versions of the same letter should be treated the same.

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

Students also viewed these Databases questions

Question

9. System creates a large, diverse talent pool.

Answered: 1 week ago