Question: 10.7: Define a class called Rational that would represent rational numbers. Write a constructor that would accept two integers and initialize the numerator and denominator

 10.7: Define a class called Rational that would represent rational numbers.

10.7: Define a class called Rational that would represent rational numbers. Write a constructor that would accept two integers and initialize the numerator and denominator of the object to their values. Also include a default constructor that would initialize the numerator to 0 and denominator to 1. Implement the member functions add, sub, mul, div, less, and equal to carry out the operations +, -;*,/,

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!