Answered step by step
Verified Expert Solution
Question
1 Approved Answer
create a program that will simulate a calculator that does the four basic mathematical operations (addition, subtraction, multiplication, and division) ask the user to submit
- create a program that will simulate a calculator
- that does the four basic mathematical operations (addition, subtraction, multiplication, and division)
- ask the user to submit two numbers and assign those numbers to two different variables
- the variables will be integers and be named number1, and number 2
- display the four operations available
- then, ask the user which operation they want to do
- use a decision structure (switch or if/else)
- compute the answer, using the correct formula
- display the answer in a sentence
- save your file as calculator.cpp
- run your program four times, so you can all four operations for accuracy (what happened when you did division? Integer division usually gives an incorrect answer.).
- to solve division issue, you have two choices:
- change variable type for number1 and number2 to double
- use typecasting just for division
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