Question: Create a class Fraction in a file Fraction.java with two integer instance variable for numerator and denominator, a constructor that accepts 2 integer values for
Create a class Fraction in a file Fraction.java with two integer instance variable for numerator and denominator, a constructor that accepts 2 integer values for numerator and denominator, a method getValue() that returns a floating-point value representing the fraction's value, and toString method that returns a String representation of the Fraction as numerator/denominator (with the correct values for numerator and denominator.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
