# 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

A. Add two fractions

B. Convert a fraction to decimal

C. Multiply two fractions

Q. Quit

Expert's answer

#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;

}

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 orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment