Question: 2. Create a structure Fraction which contains a numerator and a denominator then do the following: a. Write a function void printFraction (Fraction f)

2. Create a structure Fraction which contains a numerator and a denominator then do the following: a. Write a

2. Create a structure Fraction which contains a numerator and a denominator then do the following: 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 other's 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

3.40 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

PGM START include include structure for fraction struct Fraction int numerat... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!