Using switch statement, write a program that will ask the user which mathematical operation they like. Prompt the user to enter two integer numbers. Based from the mathematical operation selected, display the answer. Consider the following sample output: 1. Addition 2. Subtraction 3. Multiplication 4. Division Choose operation [1-4]: 1 Addition Enter 1st number: 1 Enter 2nd number: 2 The sum is: 3 Program code Sample output:

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.6: Nested Loops
Problem 4E
icon
Related questions
icon
Concept explainers
Question
Using switch statement, write a program that will ask the user which mathematical
operation they like. Prompt the user to enter two integer numbers. Based from the
mathematical operation selected, display the answer. Consider the following sample
output:
1. Addition
2. Subtraction
3. Multiplication
4. Division
Choose operation [1-4]: 1
Addition
Enter 1st number: 1
Enter 2nd number: 2
The sum is: 3
Program code
Sample output:
Transcribed Image Text:Using switch statement, write a program that will ask the user which mathematical operation they like. Prompt the user to enter two integer numbers. Based from the mathematical operation selected, display the answer. Consider the following sample output: 1. Addition 2. Subtraction 3. Multiplication 4. Division Choose operation [1-4]: 1 Addition Enter 1st number: 1 Enter 2nd number: 2 The sum is: 3 Program code Sample output:
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage