Part 1: Create an interface named Fraction. Each fraction has a numerator and a denominator that are both integers. The Interface should have a getter and setter for each.

The Fraction interface should have methods that allow a fraction to add, subtract, multiply, and divide itself with another fraction object. These methods should have a fraction as a parameter and should return the result of the operation as a fraction.

There should be a method named reciprocal() that returns the reciprocal of the receiving fraction.

There should be a method that compares a fraction with another for equality.

There should be a method that returns a String version of the fraction. Consider naming this method toString.

Part 2: Write a class named MyFraction that implements the Fraction interface. It would be good practice to give your MyFraction class a constructor that accepts two parameters, the numerator and denominator. You might also consider including code that will simplify fraction objects. For instance, 8/16 could automatically become 1/2. and -1/-3 could become 1/3.

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.