Question: 9.11 H4 I have provided a main method. Please add your fraction class. You need constructors, add, subtract, multiply, and divide methods, and a toString

9.11 H4 I have provided a main method. Please add your fraction class. You need constructors, add, subtract, multiply, and divide methods, and a toString method. The default constructor should set the numerator to zero and the denominator to 1 Your toString method needs to retum the numerator followed by / followed by the denominator - No spaces. DO NOT make any attempt to reduce the fractions (we shall do that later). 0/20 dude te LAB ACTIVITY 9.11.1: H4 File is marked as read only Current file. H4.java import java.util.Scanners public class public static void main(String[] args) { Fraction ne Fraction() test default constructor System.out.println(); Vitest to 4. senerator (4) f.setDecintor(s) test 11 System.out.println(Townerator unerator and decinator System.out.print in test constructor Fraction fraction (19) System.out.printini) Scanner keyboandnew Scarver (System.in) get the site for extractions construct it int ni keyboard.nextInt(); Int di keyboard.net Fraction one holraction (1) Weet the data for the refractie construct ni keyboard.nextInt3 keyboard.nextInto Fraction statios ini. Wasted for it lydide yatm.out.printlncone e. (to syti.out.printimone one subtraction Site out.printincend tudiant.utip 21 Usten.cut.printinore one divideti penonton 9.11 H4 I have provided a main method. Please add your fraction class. You need constructors, add, subtract, multiply, and divide methods, and a toString method. The default constructor should set the numerator to zero and the denominator to 1. Your toString method needs to return the numerator followed by / followed by the denominator - No spaces. DO NOT make any attempt to reduce the fractions (we shall do that later). LAR ACTIVITY 9.11.14 0720 Current file: Fraction.java Loud cafouilt template 1 public class Fraction private int nunerator private int denominator; 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
