OverviewFor this assignment, you will implement correct implementation problems from the previous assignment and add additional functionality. You will also write a program that uses the Fraction class to generate a game. AssignmentCorrect any problems with your implementation of the Fraction class from lab 6 and implement a few additional methods. The the UML class diagram is shown below.
In addition to the specifications from lab 6, be sure to note the following:
Pseudocode for Euclidean algorithm for greatest common divisor
int gcd(a, b) {
while b is not equal to 0 {
set t equal to b
set b equal to the remainder of a divided by b
set a equal to t
}
return a
}
Note: a, b, and t are all integers. ProgramYou should also write a simple game (in a class named Lab7 that presents the user with a random math problem involving fractions. Both fractions and the math operation (add, subtract, divide, or multiply) should be chosen at random (although you may want to place some limits on the size of the numerator and denominator values). Using a GUI interface, the program should start by presenting the user with a math problem. If the user answers the problem (answer should be in the form of a fraction), the program will indicate whether or not the user answered correctly, and then repeat the process. If the user selects cancel, the program should indicate the number of correct answers versus the number of answers given. Submission (due at 11pm the Sunday of week 9 lab)Each student must submit their class with complete functionality. In addition, each the class and each method should be documented using the javadoc format discussed in lecture and a comment at the beginning of the file must include: Course name, Quarter, Assignment name, Author's name, and date (see here). Student's must use the electronic submission form to submit their code. Enter your MSOE username for the username, select "Lab 7" for the assignment, select your Lab7.java file for the report file and select your revised Fraction.java implementation for the support file. AcknowledgmentThis laboratory assignment was developed by Dr. Chris Taylor. |