Question: Need help with this C++ problem please Given the header file fraction.h, write fraction.cpp and testFraction.cpp to test your code. testFraction.cpp should call each function:

Need help with this C++ problem please

Need help with this C++ problem please Given the header file fraction.h,

Given the header file fraction.h, write fraction.cpp and testFraction.cpp to test your code. testFraction.cpp should call each function: display(), Multiply(), operator*(), getTop() and getBottom(). The output when you run the code should be as follows: The first fraction is 42 The second fraction is 34 The third fraction is 3/8 //if it is the fraction that is created when Multiply() or operator*() is called. Hint: the definition of the display() function should show the previous output. The first fraction is created when the constructor fraction() is called. The second fraction is created when the constructor fraction(int) is called. The third fraction is created when the constructor fraction(int, int) is called. //fraction.h class fraction{ public: fraction(); fraction(int); fraction(int, int); void display(); fraction Multiply (const fraction &); fraction operator* (const fraction &); int getTop({return top;} int getBottom(){return bottom;} private: int top; int bottom; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!