This question involves the design of a class that will be used to produce practice problems. The following StudyPracticeinterface represents practice problems that can be used to study some subject. public interface StudyPractice. { /**Returns the current practive problem */ String getProblem();
This question involves the design of a class that will be used to produce practice problems. The following StudyPracticeinterface represents practice problems that can be used to study some subject.
public interface StudyPractice.
{
/**Returns the current practive problem */
String getProblem();
/** Changes to the next practice problem */
void nextProblem();
}
The MultPractice class is a StudyPracticethat produces multiplication practice problems. A MultPractice object is constructed with two integer values: first integer and initial second integer. The first integer is a value that remains constant and is used as the first integer in every practice problem. The initial second integer is used as the starting value for the second integer in the practice problems. This second value is incremented for each additional practice problem that is produced by the class.
For example, a MultPractice object created with the call new MultPractice (7, 3)would be used to create the practice problems"7 TIMES 3","7 TIMES 4","7 TIMES 5", and so on. In the MultPractice class, the getProblem method returns a string in the format of "first integer TIMES second integer". The nextProblem method updates the state of the MultPractice object to represent the next practice problem.
The following examples in the attachments illustrate the behavior of the MultPracticeclass. Each table shows a code segment and the output that would be produced as the code is executed.
Accordingly, write the complete MultPractice class. Your implementation must be consistent with the specifications and the given examples.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images