Problem

Define a rational number class. A rational number is a number composed of two integers wit...

Define a rational number class. A rational number is a number composed of two integers with division indicated, as in 1/2, 2/3, 4/5. A rational number is defined using two integer objects; numerator and denominator. Overload the ≪ and ≫ operators and arithmetic operators to perform the following operations:

a/b + c/d = (a*d + b*c) / (b*d) (addition)

a/b - c/d = (a*d - b*c) / (b*d) (subtraction)

(a/b) * (c/d) = (a*c)/(b*d) (multiplication)

(a/b) / (c/d) = (a*d) /(c*b) (division)

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 10
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT