Answered You can hire a professional tutor to get the answer.

QUESTION

Comments are REQUIRED; flow charts and Pseudocode are NOT REQUIRED. Directions The files must be called lt;LastNameFirstNameProg7.javagt;. (driver)...

Comments are REQUIRED; flow charts and Pseudocode are NOT REQUIRED.Directions The files must be called <LastNameFirstNameProg7.java>. (driver)Fraction.java (handles the fractional numbers)Example: MouseMickeyProg7.java Fraction.javaEnsure you include ALL files required to make your program compile and run.I would like to see your .java files only.Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter. Basic RequirementsWrite a driver and fraction class that performs addition, multiplication, prints the fraction, and prints as a double.LastNameFirstNameProg7.javaProvide a driver class, LastNameFirstNameProg7, that demonstrates this Fraction class. The driver class should contain this main method:public static void main(String[] args){Scanner stdIn = new Scanner(System.in);Fraction c, d, x; // Fraction objectsSystem.out.println("Enter numerator; then denominator.");c = new Fraction(stdIn.nextInt(), stdIn.nextInt());c.print();System.out.println("Enter numerator; then denominator.");d = new Fraction(stdIn.nextInt(), stdIn.nextInt());d.print();x = new Fraction(); // create a fraction for number 0System.out.println("Sum:");x.add(c).add(d);x.print();x.printAsDouble();x = new Fraction(1, 1); // create a fraction for number 1System.out.println("Product:");x.multiply(c).multiply(d);x.print();x.printAsDouble();System.out.println("Enter numerator; then denominator.");x = new Fraction(stdIn.nextInt(), stdIn.nextInt());x.printAsDouble();} // end mainNote that this demonstration driver does not call the accessor methods. That’s OK. Accessor methods are often implemented regardless of whether there’s an immediate need for them. That’s because they are very useful methods in general and providing them means that future code can use them when the need arises.Fraction.javaWrite a Fraction class called Fraction.java that implements these methods:add ─ This method receives a Fraction parameter and adds the parameter fraction to the calling object fraction.multiply ─ This method receives a Fraction parameter and multiplies the parameter fraction by the calling object fraction.print ─ This method prints the fraction using fraction notation (1/4, 21/14, etc.)printAsDouble ─ This method prints the fraction as a double (0.25, 1.5, etc.)Separate accessor methods for each instance variable in the Fraction class.Sample Output:Enter numerator; then denominator.585/8Enter numerator; then denominator.4104/10Sum:82/801.025Product:20/800.25Enter numerator; then denominator.60infinity

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question