Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program named Lab11C in C++ that will act as a calculator, allowing the user to type in an equation and calculating the result.

image text in transcribed

Write a program named Lab11C in C++ that will act as a calculator, allowing the user to type in an equation and calculating the result. a. Ask the user to enter 2 integers with a character between them, all separated by spaces. The character should be +,,,l, or % b. Input the 2 numbers and the character oper. (oper will be the operator, but we can't use operator as a variable name because it's a reserved word.) c. Write a switch statement based on oper, that will perform the mathematical operation on the numbers. d. Print the whole equation with the result in the following format: If the user types in 40/5, then the output should be: 40/5=8 (You have worked with output statements enough that you should be able to do this.)

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

Students also viewed these Databases questions

Question

8-15 Explain how a cyberattack can be carried out.

Answered: 1 week ago