The purpose of this project is to create a class called Rational for performing arithmetic with fractions. The program has integer variables to represent the private data of the class and a constructor that initializes an object when it's declared. In addition, it has public member functions that performs each of the following tasks.
- Add two Rational numbers.
- Subtract two Rational numbers.
- Multiple two Rational numbers.
- Divide two Rational numbers.
- Print the Rational numbers in the form a/b, where a is the numerator and b is the denominator.
- Print the Rational numbers in floating-point form
Note: All results were stored in reduced form and Operator Overloading was used in the program.