Question
Create a structure Fraction which contains a numerator and a denominator then do the following (In C++): a. Write a function void printFraction(Fraction f) which
Create a structure Fraction which contains a numerator and a denominator then do the following (In C++): a. Write a function void printFraction(Fraction f) which prints out a fraction in the following format; e.g. if the numerator is 2 and the denominator is 5, it will print out 2/5 b. Write a function Fraction mult(Fraction f1, Fraction f2) which returns a new fraction which is the product of f1 and f2. c. Write a function Fraction add(Fraction f1, Fraction f2) which returns a new fraction which is the sum of f1 and f2. You may simply multiply each fraction by the others denominator to find a common denominator; e.g. (3/4)+(5/6) = (3*6/4*6)+(5*4/6*4) = 38/24. You do NOT have to reduce the fractions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started