Question: Define an ADT for a Rational class, i.e. a collection of methods, class variables (if necessary) and attributes (I necessary). Recall that a rational number

Define an ADT for a Rational class, i.e. a collection of methods, class variables (if necessary) and attributes (I necessary).

Recall that a rational number is a number that can be represented as a fraction a/b, where both a, b Z and b 0. Keep it simple but define methods. Assume that we only want to create a fraction, be able to access its numerator and denominator, and to display it. Do not add addition, subtraction, etc. of fractions.

Dont forget to put brief descriptions with pre- and post-conditions.

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!