The purpose of this lab is to use separate files and vectors.
You are encouraged to work together on this.
Using the Rational code linked
here
-
split the code into two files (.h and .cpp)
- Use ifndef
- Create a main in a 3rd file and verify that you can create rational numbers
- Test it
- Create 3 rational numbers (1/2, 3/4, and 5/8)
- Multiply them together and print the product
- Create a vector of rational numbers
- push back your 3 rational numbers into the vector
- Change the vector element that contains 1/2 to be 9/10
- Write a loop to multiply the 3 elements of the vector
A partial solution is available