Question: C++ question 1. Write a program that will determine if an integer between 10,000 and -10,000, entered by the user, is an even or an
C++ question
1. Write a program that will determine if an integer between 10,000 and -10,000, entered by the user, is an even or an odd value and also if it is a negative or positive value. (For simplicity reasons, zero is considered a positive, even value.)
a. Use main( ) as the driver function. Allow the user to run the program as many times as desired.
b. Write the function getNumber ( ) that prompts the user for the whole number to be determined as even/odd or positive/negative and returns this value back to main( ). Do not allow the user to enter a value outside of the range specified. Display an error message and keep prompting until a valid value is entered.
c. Write the function determineEvenOrOdd( ) to determine if the integer value is even or odd and return a determination value to main( ).
d. Write the function determinePositiveOrNegative( ) to determine if the integer value is positive or negative and return a determination value to main( ).
e. Write the function displayResults( ) to display the number entered by the user and the determination of even or odd and positive or negative.
Sample Input/Output:
Please enter the number to be determined as even/odd or positive/negative: 25
The number you entered, 25 is a positive, odd value.
Would you like to process another number? < Y or N > y
Please enter the number to be determined as even/odd or positive/negative: -12
The number you entered, -12, is a negative, even value.
Would you like to process another number? < Y or N > n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
