Question
The purpose of this programming project is to write a C++ program to perform a simple arithmetic operation based on user input that uses if-statements,
The purpose of this programming project is to write a C++ program to perform a simple arithmetic operation based on user input that uses if-statements, switch-statements, and loops.
You will prompt the user for and read in an integer between 0 and 25, inclusively. If the integer is not in range, you will display a meaningful message indicating it is either less than 0 or greater than 25, and then continually re-prompt the user to enter the integer again until the user enters a valid integer.
Once the user has entered a valid integer, you will then prompt the user for and read in a second integer between 15 and 30, inclusively. If this second integer is not in range, you will display a meaningful message indicating it is either less than 15 or greater than 30, and then continually re-prompt the user to enter the integer again until the user enters a valid integer.
Once both integers have been entered, you will prompt the user for and read in the arithmetic operation that the user wishes to perform as follows: addition (+), subtraction (), multiplication (*), division (/), or modulus (%). If the user enters an operation other than those listed, you will display a meaningful message indicating that the operation is invalid, and then exit the program (i.e., not perform the requested operation).
You will then perform the requested arithmetic operation as input by the user, showing the details of the operation (i.e., the actual operation being performed). Additionally, you will display a meaningful message indicating whether the result of the operation was negative, zero, or positive. Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code.
Example of OutPut
Enter an integer between 0 and 25, inclusively: 16 Now enter a second integer between -15 and 30, inclusively: -4 Enter the arithmetic operation (+, -, *, /, or %) you'd like to perform : * Multiplicatin: 16 * -4 = -64 The result of the operation (-64) is negative! mat0299@faculty:~/csce1030S ./a.out mat0299@faculty:/csce1030s ./a.out
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started