Write a client program eg fractiondemojava to test your


Write a class (eg, Fraction.java) for handling fractions that each have an integer numerator and an integer denominator. The two instance variables can be publicly accessible. Supply an input method to get a fraction (as two separate integers) from the user. Supply an output method to print out the fraction on the screen. The fraction is to be output in the form: numerator/denominator. Half, for example, should be printed out as 1 / 2.

Write a client program (eg FractionDemo.java) to test your fraction class. The program should loop around getting fractions from the user and displaying them on the screen. Stop when the numerator is negative.

Note that the client program must use the fraction class methods to read and display fractions.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a client program eg fractiondemojava to test your
Reference No:- TGS02398297

Now Priced at $10 (50% Discount)

Recommended (95%)

Rated (4.7/5)