Question: Write a Java program with the following specifications: 1. Define 2 private attributes in Fraction class, the numerator and the denominator. Define the constructor for
Write a Java program with the following specifications:
1. Define 2 private attributes in Fraction class, the numerator and the denominator. Define the constructor for this class.
2. Define the setters (mutators) and the getters (accessors) for the Fraction class.
3. Define also the following custom methods in the Fraction class:
a. showFractionForm
b. determineLowestTerm
c. determineDecimalEquivalent
d. determineFractionType
4. The fraction types are as follows:
a. Proper Fraction numerator is less than the denominator
b. Improper Fraction numerator is greater than the denominator, but the quotient is a real number (ex: 3.45)
c. Whole Number numerator is greater than the denominator, but the quotient has no decimal part
5. Create a main class named Math. This class should contain the main method.
6. Instantiate an object of the Fraction class in the main method.
7. Invoke the methods of the Fraction class in the main method to display the requirements as shown in the sample output:-
8. The program should loop back to data entry upon confirmation by the user and will terminate as confirmed by the user.
9. Assume that the program user will only input integer values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
