c++ Your task is to create a class called fraction. This class will have two integer data members namely numerator and denominator. To make the task simple suppose that all fraction have the same denominator i.e. 5. Follow the requirements given below: Create a fraction object called sum that will hold the sum of two fractions by using the + operator. Create a fraction object called difference that will hold the difference of two fractions by using the – operator Create a fraction object called multiple that will hold the product of any two fractions by using the * operator Overload the + operator so that it works with a fraction class object. Overload the – operator so that it works with a fraction class object. Overload the * operator so that it works with a fraction class object. In the end create a display function through which you can display your fractions.
c++
Your task is to create a class called fraction. This class will have two integer data members namely
numerator and denominator. To make the task simple suppose that all fraction have the same
denominator i.e. 5. Follow the requirements given below:
Create a fraction object called sum that will hold the sum of two fractions by using the +
operator.
Create a fraction object called difference that will hold the difference of two fractions by
using the – operator
Create a fraction object called multiple that will hold the product of any two fractions by
using the * operator
Overload the + operator so that it works with a fraction class object.
Overload the – operator so that it works with a fraction class object.
Overload the * operator so that it works with a fraction class object.
In the end create a display function through which you can display your fractions.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images