Question: a) Design and implement a Comparable Java class to represent a Rational number such as 3/2. Your class will have the following methods as well

a) Design and implement a Comparable Java class to represent a Rational number such as 3/2. Your class will have the following methods as well as any other methods necessary (setters, getters, etc.). - A constructor that takes all parameters (numerator, denominator), - A function that returns the number of existing Rational objects, - Override the tostring method, - Methods for adding and multiplying Rational objects, - Your methods will throw exceptions if there are problems. b) Write another class to test your Rational class including the exceptions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
