Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Input is from a file and indicates an operation ofarithmeticto perform on two fr

ID: 3618393 • Letter: I

Question

Input is from a file and indicates an operation ofarithmeticto perform on two fractions. Example: input lines could be: 2/5 + 3/8 4/9 - 1/3 5/23 * 2/5 13/16 / 5/8 the program should do appropriate input checking. The program will use four functions to carry out thearithmtic, one for each arithmetic operation. Output i to a file, and specifies the original input followedby an equal sign and the fraction(numerator/denominator) that isthe result. Also let the program express te answer fraction in lowestterms Input is from a file and indicates an operation ofarithmeticto perform on two fractions. Example: input lines could be: 2/5 + 3/8 4/9 - 1/3 5/23 * 2/5 13/16 / 5/8 the program should do appropriate input checking. The program will use four functions to carry out thearithmtic, one for each arithmetic operation. Output i to a file, and specifies the original input followedby an equal sign and the fraction(numerator/denominator) that isthe result. Also let the program express te answer fraction in lowestterms

Explanation / Answer

#include

using

char

void

void

void

void

int

{

menu(operation);

cin>>nume1>>denom1>>nume2>>denom2;

{

cout<<

cout<<

}

{

{

addfractions(nume1,denom1,nume2,denom2);

}

{

subtractfractions(nume1,denom1,nume2,denom2);

}

{

multiplyfractions(nume1,denom1,nume2,denom2);

}

{

dividefractions(nume1,denom1,nume2,denom2);

}

{

cout<<

}

}

}

char

{

cout<<

cout<<

cout<<

cin>>op;

}

void

{

f=b*d;

e=a*d+b*c;

cout<<a<<