Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C + + program to generate a short menu that asks the user to select a . Add, b . Multiply, or q

Write a C++ program to generate a short menu that asks the user to select a. Add, b. Multiply,
or q. Quit. If add or multiply is selected, then input two integers and output their sum or
product. The menu should then repeat. If quit is selected, the program should exit.
Here is a sample execution, with user input in blue bold:
Select from the menu.
a. Add
b. Multiply
q. Quit
a
Enter two integers to add, separated by whitespace.
23
The sum is 5
Select from the menu.
a. Add
b. Multiply
q. Quit
b
Enter two integers to multiply, separated by whitespace.
-10
20
The product is -200
Select from the menu.
a. Add
b. Multiply
q. Quit
a
Enter two integers to add, separated by whitespace.
100200
The sum is 300
Select from the menu.
a. Add
b. Multiply
q. Quit
q

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

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions