Question: CS 1 - LAB 0 5 - Read and Compare Two Integers Develop a C + + application that solves the following problem: Request the

CS1- LAB05- Read and Compare Two Integers
Develop a C++ application that solves the following problem:
Request the user to input a positive even integer number and store it in variable a. If the
input is invalid, prompt the user to retry the input operation until a valid number is entered.
Repeat the input-validation process as in step 1 to obtain a positive odd integer number and
store it in variable b. Similarly, prompt the uscr to retry the input operation until a valid odd
number is entered.
Compare the values of a and b. If a is greater than or equal to b, output the message
"The first number ( a value here) is larger or equal than the second (b value here)."
Otherwise, output the message
"The second number (b value here) is larger or equal than the first (a value here)."
Note: Use only the programming features that have been covered in chapters 1-5.
The following is a sample run (Use this sequence to test your app).
Enter a positive EVEN integer: -10
Error - Expecting a POSITIVE EVEN number - Please, try again.
Enter a positive EVEN integer: 9
Error - Expecting a POSITIVE EVEN number - Please, try again.
Enter a positive EVEN integer: 8
Enter a positive ODD integer: 4
Error - Expecting a POSITIVE ODD number - Please, try again.
Enter a positive ODD integer: 5
The first number (8) is larger or equal than the second (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 Programming Questions!