Question: how do I fix this issue ile: Fraction.java lic class Fraction I/private fields for numerator and denominator private int num; private int denom; I/constructor public




how do I fix this issue
ile: Fraction.java lic class Fraction I/private fields for numerator and denominator private int num; private int denom; I/constructor public Fraction (int n, int d ) \{ //assign n to the num field num =n; //use setDenom( ) setter to protect against divide by zero setDenom(d); \} I/ setter method for the numerator field public void setNum(int n ) \{ num =n; \} // setter method for the denominator field public void setDenom(int d) \{ //protect against zero in the denominator if (d:=) denom =d; else \{ //inform user denom cant' t be zero System.out.println("For Fraction: " + this.toString() + " System.out.println("Denominator cannot be zero; denominat, \{ /llocal variables for the new numerator and new denominator int newNum, newDenom; // get the new numerator by multiplying the two numerator newNum =( this getNum()f2getNum()); //get the new denominator by multiplying the two denominators newDenom = this getDenom()f2getDenom(); //call constructor to instantiate the new Fraction return new Fraction (newNum, newDenom); \} //tostring to format how to display all fractions public string tostring() \{ // local string variable to format the fraction String strFraction; if ( denom ==1 ) l/ if denom is 1 ; this is an integer strfraction = " ("+ num + " )"; else strfraction ="("+ num +"/"+ denom +")"; return strfraction; \} \} //end of Fraction class definition ..j GRASP wedge2: exit code for process is 1. -..-jGRASP: operation complete. ...-jGRASP exec: java Fraction Error: Main method not found in class Fraction, please define the main plethod as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
