Create a class Rational for performing arithmetic with fractions.
Take two private data members –the numerator and the denominator .Provide a constructor that enables an object of this class to be initializes when it is declared. The constructor should contain default values in case no initialization are provided and should store the fraction. Provide public member functions that perform each of the following tasks
a) Adding two and three rational numbers.(use function overloading)
b) Subtracting two and three rational numbers.(use function overloading)
c) Multiply two rational numbers.
d) Dividing two rational numbers.
e) Printing rational numbers, in the form a/b ,where a is the numerator and is the denominator
I guess I'd start by thinking about what steps you have to go through when doing arithmetic with fractions. For example - adding 1/2 and 1/5 - you can't add them as they are, you need to get them under a common denominator first.