C++ question 1. Write a program that will determine if an integer between 10,000
ID: 3806029 • Letter: C
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 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 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 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 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 > nExplanation / Answer
#include void main () { int a; clrscr(); printf (" Enter a Number : "); scanf ("%d",&a); if (a==0) printf (" The Entered number is 0"); if (a%2==0 && a>0) printf (" The Number is Even and +ve"); if (a%2==0 && a0) printf (" The Number is Odd and +ve"); if (a%2!=0 && aRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.