Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ program. the second picture is kinda startling the program. For this lab, we will build a 4-function calculator, performing calculations only on Integers. The
C++ program. the second picture is kinda startling the program.
For this lab, we will build a 4-function calculator, performing calculations only on Integers. The user should be prompted to continually enter an equation in the form of a +boraxb, etc. The calculator should support the following functions: Addition (a + b) Subtraction (a - b) Multiplication (axb) Division (a / b) Each time a valid calculation has been entered the results of the operation should be printed out also in the form of an equation (e.g., 3 x 7 = 21). I will show you how to read 3 parameters from the same input line. Also, you need to use a "switch statement to help you code this lab assignment. Some kind of repetitive loop will also be needed. Divide-by-zero - any number divided by O is invalid An example execution of the calculator program is given below. Example execution: $ ./calculator.out Enter an equation or 0x 12 / 4 = 3 to exit: 12 / 4 to exit: 4 x 2 Enter an equation or 0x 4 X 2 = 8 Enter an equation or o xo to exit: 5 x -10 5 x 10 = -50 Enter an equation or o xo to exit: 5 + 10 5 + 10 = 15 Enter an equation or exoto exit: 10 - 30 10 - 30 = -20 Enter an equation or o X o to exit: 13 / Error -- cannot divide by O Enter an equation or 0x to exit: @xe Thanks for using the calculator. Goodbye. 3 #includeStep 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