Your Perfect Assignment is Just a Click Away
We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

Assignment: Creating a file on Fraction.java

Assignment: Creating a file on Fraction.java

1. Create a new file called Fraction.java
2. In this file, create a class Fraction. 
a. This class should have 2 attributes, declare it, don’t forget those fields/attributes need to be private
b. Create 2 constructors,
i. One constructor without any parameter. This constructor will initialize the first attribute to 0 and the second to 1.
ii. The second constructor will have 2 parameters that will initialize the 2 attributes of the Fraction class.
c. Create a getter and a setter for each private fields.
d. Create 4 methods, addition, subtract, multiply, divide.  Don’t forget to declare those methods public so every objects can use  them. Since those methods needs to be called by an instance of the class  Fraction, what do those methods need to achieve the  addition/subtraction/multiplication/division of TWO fractions. The 4  methods need to return a brand NEW fraction result of the addition/subtraction/multiplication/division of the 2 fractions. a/b + c/d = a/b – c/d = a/b * c/d = a/b / c/d 
e. Create a method properFraction,  that has no parameter. This method will return a whole number and  modify the original Fraction to a proper Fraction. For instance:
   Fraction f1 = new Fraction(7,2);// f1-> 7/2
   System.out.print(f1.properFraction());// output: 3, f1->1/2
   Fraction f2 = new Fraction(2,5); // f2-> 2/5
   System.out.print(f2.properFraction());// output: 0, f1->2/5
f. Create a method toString that will return a String made with the 2 attributes with the following format “4/3”.
3.  In the Main.java file, create 3 Fractions with different values. Test  the addition/subtraction/multiplication/division and the properFractions  methods.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Homework Free only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Homework Free are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Homework Free is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Homework Free, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

Homework Free Org

Your one stop solution for all your online studies solutions. Hire some of the world's highly rated writers to handle your writing assignments. And guess what, you don't have to break the bank.

© 2020 Homework Free Org