Mixed Fraction Classes: Exercise
Test your understanding with this exercise.
In this lesson, we’ll implement the code for the missing three fraction functions: subtraction, multiplication, and division.
Your implementation
Following the instructions, write your own implementation here:
Exercise: Complete the MixedFraction class
The first exercise is to add three prototypes to the MixedFraction.h file inside the MixedFraction class declaration.
Exercise 2: Implement the multiply() function
Write the multiply() function (in MixedFraction.cpp) as a member function in the MixedFraction class and uncomment the lines in main() where multiply() is called.
Exercise 3: Implement the division() function
Write the division() function (in MixedFraction.cpp) as a member function in the MixedFraction class and uncomment the lines in main() where division() is called.
If you have trouble getting to the solution, you can click the “Show Solution” button to see how to implement it.