Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Write a program in C++ which adds, subtracts, multiplies, divides and perform exponentiation on two specific numbers. The two numbers should be entered by the user. Each output should include a string...

1 answer below »

Write a program in C++ which adds, subtracts, multiplies, divides and perform exponentiation on two specific numbers. The two numbers should be entered by the user. Each output should include a string describing what the numerical output is being displayed.

Use the switch blockso that the user is able to selectwhich mathematical function to perform. Make sure the program has a neat menu for the user to use to select their choice. Also, avoid having the computer perform a division by zero if the user attempts it by outputting a warning message in its place (You can use an if statement to execute this). Include your C++ source code as well as the output of your program in your submission


Answered Same Day Mar 17, 2021

Solution

Aditya answered on Mar 18 2021
158 Votes
#include #include using namespace std;
int main()
{
int num1 , num2;
int option;
while(true)
{
cout
"\nSelect from the below options: "
endl;
cout
"Press 1 for Addition"
endl;
cout
"Press 2 for Subtraction"
endl;
cout
"Press 3 for Multiplication"
endl;
cout
"Press 4 for division"
endl;
cout
"Press 5 for exponential"
endl;
cout
"Press 6 to exit the program"
endl;
cout
"Your option: ";
cin
option;
switch(option)
{
case 1:
{
cout
"Enter number 1: ";
cin
num1;
cout
"Enter number 2: ";
cin
num2;
int sum = num1 + num2;
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here