Question: Please help in Java : Create a fraction class. This will have two attributes, a numerator and a denominator, both int. This class will have
Create a fraction class. This will have two attributes, a numerator and a denominator, both int. This class will have
- constructors
- accessors and mutators (for the attributes)
- a toString method which will allow us to print the fraction in the form 3/4
- an Add method so we can add two fractions
- a subtract method (subtracts one fraction from the other)
- a multiply method (multiply two fractions)
- a divide method (divides one fraction by the other)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
