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 DayMar 17, 2021

Answer To: Write a program in C++ which adds, subtracts, multiplies, divides and perform exponentiation on two...

Aditya answered on Mar 18 2021
156 Votes
#include
#include
using namespace std;
int main()
{
int num1 , num2;
int option;
while(true)
{
cout<<"\nSelect from the below options: "< cout<<"Press 1 for Addition"< cout<<"Press 2 for Subtraction"< cout<<"Press 3 for Multiplication"< cout<<"Press 4 for division"< cout<<"Press 5 for exponential"< cout<<"Press 6 to exit the program"< 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