Write a C++ fraction calculator program that adds, subtracts, multiplies, and divides fractions. Your program should check for the division by 0, have and use the following functions:
(a) abs - returns the absolute value of a given integer.(b) min - returns the smallest of two positive integers.(c) gcd - returns the greatest common divisor of two positive integers.(d) reduce - reduces a given fraction.(e) flip - reduces a given fraction and flips the sign if the denominator is negative.(f) add - finds the reduced sum of a pair of given fractions.(g) subtract - finds the reduced difference of a pair of given fractions, by makingthe second fraction negative then using the add function.(h) multiply - finds the reduced product of a pair of given fractions.(i) divide - finds the reduced quotient of a pair of given fractions by inverting the second fraction then using the multiply function.
Sample Runs:Fraction Calculator 1.0Enter an arithmetic expression of the form a/b operator c/d,replace operator by any one of +, -, *, or / ˜$ 2/4 + 1/3Solution: (1/2) + (1/3) = 5/6Again (Y/N)? Y
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here