Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++. Write a program that will enable a user to do simple mathematical calculations. You must do it from scratch - don't forget the

In C++. Write a program that will enable a user to do simple mathematical calculations. You must do it from scratch - don't forget the magic!

It will need to do the following: 1. Prompt the user with the following string: "1) addition 2) subtraction 3) multiplication 4) division: " 2. Input their choice into an integer variable named whatever you want. 3. Prompt them with the following string: "Please enter two numbers: " 4. Input two integers from the keyboard into two variables called whatever you want. 5. Do the math of their choice (i.e. if they typed 3 9 6, you will subtract (choice 3) 9 and 6). 6. Output the result to the screen and quit.

7. Validate the input - NO DIVISION BY ZERO (or modulus by zero) and check to make sure they typed a number between 1 and 4 for the operator. If they gave a bad input: output "BAD INPUT!" and quit. 8. Add modulus as option #5. Don't change the prompt (in #1), it will be a secret easter egg. Also modify #7 so it doesn't output BAD INPUT! on a 5.

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_2

Step: 3

blur-text-image_3

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

What are the best practices for managing a large software project?

Answered: 1 week ago

Question

How does clustering in unsupervised learning help in data analysis?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago