Answer to Question #27376 in C++ for red rose

Question #27376
A fraction-handling program contains this menu:
A. Add two fractions
B. Convert a fraction to decimal
C. Multiply two fractions
Q. Quit
1
Expert's answer
2013-03-29T15:00:48-0400
#include <iostream>

using namespace std;

int main() {
cout<< "A. Add two fractions
"
"B.Convert a fraction to decimal
"
"C.Multiply two fractions
"
"Q.Quit
";

boolok_choice = false;
while(ok_choice != true) {
charchoice;
cout<< "Please enter your choice: ";
cin>> choice;
//inOK cases you can insert functions that you need
switch(choice) {
case'A':
cout<< "ADD
";
//addFrac(Frac1,Frac2); - example
ok_choice= true;
break;
case'B':
cout<< "ToDecimal
";
ok_choice= true;
break;
case'C':
cout<< "Multiply
";
ok_choice= true;
break;
case'Q':
cout<< "Quit
";
ok_choice= true;
break;
default:
cout<< "Bad choice!
";
break;
}
}
return0;
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS