Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ using if and if else Problem Statement- A program is required which will act as a calculator. The program should prompt the user to
C++ using if and if else
Problem Statement- A program is required which will act as a calculator. The program should prompt the user to enter 2 integers and a code. The program should perform the following actions based on the code entered. . . . . A code of 1 indicates that the two numbers should be added A code of 2 indicates that the two numbers should be multiplied A code of 3 indicates that the first number should be divided by the second number A code of 4 indicates that the first number should be subtracted from the second number. The program should then print both numbers, with appropriate labels as well as the sum, difference, product or quotient with an appropriate label indicating what is being printed. This process should be repeated until 2 zeros are entered. An appropriate message should then be printed to notify the user of the end of the program Sample Output Please enter a number 3 Please enter another number 6 Please enter the code 1 The first number is 3 and second number is 6. The sum of these numbers isS9 Please enter a number 4 Please enter another number 5 Please enter the code 2 The first number is 4 and the second number is 5. The product of these numbers is 20
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started