Question
General Description Your assignment is to complete the Fraction class and use it to create a tutorial to allow students to add, subtract, multiply, divide
General Description
Your assignment is to complete the Fraction class and use it to create a tutorial to allow students to add, subtract, multiply, divide and simplify fractions. Add any additional methods to the Fraction class that may be needed for the following modifications
Fraction Class Modifications
Add the divide, add, and subtract methods as specified on the UML
Add a method to determine if a fraction is improper
Add a method which will convert the fraction to a decimal number (2/3 would be converted to 0.67)
Modify the toString() method which prints the fraction object in the following format
2/3 if it is a proper fraction, or 3 if it is an improper fraction. A whole number if the denominator is 1, and 0 if the numerator is 0.
FractionTutorial Class Description
Create a FractionTutorial class which will do the following.
Allow the user to choose if they want to practice addition, subtraction, multiplication, division, simplifying, converting fractions to decimal or stop.
Provide 2 levels of play. Allow the user to choose the level. Level 1 should randomly generate numerator and denominator values between 1 and 10. Level 2 should generate random numbers from 1 to 50.
Provide 5 problems, one at a time, to the user. Allow the user to enter their solution to the problem. If the users solution is equal to the solution congratulate them, otherwise, tell them the correct answer and encourage them to keep trying.
After the user has completed the 5 problems (correct or incorrect) let them know how many questions they answered correctly and allow them to do one of the following.
Solve 5 more of the same operation at the same level
Start over with a new operation and/or level.
Documentation
Method Header in Fraction: JavaDoc Format Lists purpose of the method, parameters and return value.
Code Comments in FractionTutorial: You must provide comments describing the purpose of each logical section of your code in both Fraction and FractionTutorial. In addition, the format of your code must follow the good programming principles as discussed in class and in your textbook. This means that you must use blank lines and indentation to arrange and/or separate logical sections of your code. You must also use meaningful variable names in order to receive full credit
Submit Fraction.java and FractionTutorial.java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started