98 786
Assignments Done
98.6%
Successfully Done
In April 2021

# Answer to Question #29627 in C++ for Rose

Question #29627
Develop a menu-driven program that inputs two numbers and, at the user's options, find their sum, difference, product, or quotient.
1
2013-05-27T13:05:54-0400
#include <iostream>
#include <conio.h>

using namespace std;
//main function
int main()
{
//variables
float fisrtnumber;
float secondnumber;
float sum;
float difference;
float product;
float quotient;
int ch;//choice
//input fisrt number and second number
cout<<"Enter first number: ";
cin>>fisrtnumber;
cout<<"Enter second number: ";
cin>>secondnumber;
do{
cout<<"
1 - sum";
cout<<"
2 - difference";
cout<<"
3 - product";
cout<<"
4 - quotient";
cout<<"
5 - exit";
cin>>ch;
switch(ch){
case 1:
sum=fisrtnumber+secondnumber;//find sum
cout<<"Sum = "<<sum<<"

";//show sum
break;
case 2:
difference=fisrtnumber-secondnumber;//find difference
cout<<"Difference =
"<<difference<<"

";//show difference
break;
case 3:
product=fisrtnumber*secondnumber;//find product
cout<<"Product =
"<<product<<"

";//show product
break;
case 4:
quotient=fisrtnumber/secondnumber;//find quotient
cout<<"Quotient =
"<<quotient<<"

";//show quotient
break;
}
}while(ch!=5);//exit
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!