Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago