Question
Your program should present a menu with 4 options, 1) Print author info 2) perform integer operation 3) perform floating point operation 0) Exit Where
Your program should present a menu with 4 options, 1) Print author info 2) perform integer operation 3) perform floating point operation 0) Exit
Where selection 1 prints your information (name and student id) selection two performs an integer math operation selection 3 performs a floating point (non whole number) math operation. Selection 0 will exit the program immediately. Any other selection will print an error message stating that an invalid selection was made.
When one of the math operation selections are chosen, the user will enter a simple math formula (such as "1+1") you should then calculate the result of their entered formula and print both the operation and the result to the screen. The result should be preceeded by the text "OUTPUT: " The result should include two values to the right of the decimal. for example if the user entered: "4*6"
You would print: OUTPUT: 4 * 6 = 24.00
You can expect the user to enter the formula in the format of: op1
The operations you must support are: + addition - subtraction * multiplication / division % modulus (integer operations only)
Make sure your results are mathematically correct (you will be graded on math as if this were a math class.
To get full credit you need to follow the output rules exactly. the file check.sh can be used to check some basic operations for your program. Run it from the command prompt using the following syntax ./check.sh _path_to_executable
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