Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!