Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Have a program that mimics a simple integer calculator using the switch statement (i.e. you must use a switch statement to implement your calculator). The

Have a program that mimics a simple integer calculator using the switch statement (i.e. you must use a switch statement to implement your calculator). The program should input two integer numbers and the operation to be performed on them as input, then output the numbers, the operator, and the results as illustrated below. Use a for loop to input seven sets of inputs as illustrated below (in zyBooks you must enter these seven sets of inputs all at once in the input window). Assume that the operands will always be valid integers (i.e. you do not need to check for input failure). For division, the program should also output the remainder and check if the denominator is zero (and output an appropriate message as shown below). If the operation is not recognized, an appropriate message should be output (as shown below). Test your program thoroughly!

As an example, for input:

10 5 + 25 35 - -1 -1 * 9 6 / 0 1 / 1 0 / 2 4 !

The Output should be(each on separate lines):

10 + 5 = 15

25 - 35 = -10

-1 * -1 = 1

9 / 6 = 1R3

0 / 1 = 0R0

1 / 0 = ERROR

2 ! 4 = ILLEGAL

The program I created only outputs the first three inputs and I need help with a program that outputs the rest. Please help!

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions