JAVA HELP! Can you add questions and covert chapter numbers into points and make an application that calls them over 100? Create a new NetBeans 8.2 Java 8 project called TestSimulator. Add the eight classes from the UML class diagram in a package called “testsimulator” as shown below. Create a class stub for each class such as below: public class ClassName { } Add the necessary additional keywords for classes that inherit from interfaces or abstract classes. Part 2: Main menu Consult the UML class diagram and add implementation to the TestSimulator class as follows: getSelection() method: • Print the following menu-based messages: Welcome to the TestSimulator program menu. Select from one of the following options. (1) New test. (2) Test summary. (3) Exit. Enter your selection: • Accept the choice from the user. • Ask the user to enter their choice again if a non-number is received. main() method: • Add a loop that runs the getSelection() method until the user enters option (3). • Add a branching construct that prints a message regarding the user’s choice for each option. • The program finishes normally after option (3) is selected. Part 3: Question class The Question class is an abstract class that represents one question for a test. It contains details about the question, but not much about the answers. This is because there are different types of answers (i.e.: multiple-choice versus true/false) and those details will be implemented elsewhere. Consult the UML class diagram and add implementation to the Question class based on these guidelines: • The isAnswerCorrect() method is an abstract method. I.e.: It has no body. • No further notes are given about the other members (fields, constructors and methods), so use the UML class diagram to guide your implementation. Part 4: MultipleChoiceQuestion class The MultipleChoiceQuestion class adds extra functionality inherited from the Question class to represent one multiple-choice question for a test. It adds extra details about the answers. Consult the UML class diagram and add implementation to the MultipleChoiceQuestion class based on these guidelines: • The isAnswerCorrect() method is overridden from the Question class. It returns true if “correctAnswer” and “chosenAnswer” are the same, otherwise false. • The constructor accepts “answer1”, “answer2”, “answer3” and “answer4” separately, but they are stored together as “answers” of type String[4]. • Field “chosenAnswer” takes a default value of ‘a’, which is the first answer. • No further notes are given about the other members (fields, constructors and methods), so use the UML class diagram to guide your implementation. Part 5: TrueFalseQuestion class The TrueFalseQuestion class adds extra functionality inherited from the Question class to represent one true-false question for a test. It adds extra details about the answers. Consult the UML class diagram and add implementation to the TrueFalseQuestion class based on these guidelines: • The isAnswerCorrect() method is overridden from the Question class. It returns true if “correctAnswer” and “chosenAnswer” are the same, otherwise false. • Field “chosenAnswer” takes a default value of ‘true’, which is the first answer. • No further notes are given about the other members (fields, constructors and methods), so use the UML class diagram to guide your implementation. Part 6: QuestionFinder interface The QuestionFinder interface provides the containsQuestion() method used in the QuestionBank and Test classes. It provides one method with the following definition: public default boolean containsQuestion(String questionID, ArrayList questions) { ... } The method returns true if the “questionID” is found in the “questions” ArrayList, otherwise false. This method is implemented as a concrete method. Concrete methods are allowed in interfaces provided that the default keyword is used. This is a new feature added to Java version 8. 7 Implement the containsQuestion() method in the QuestionFinder interface based on the above guidelines.
JAVA HELP!
Can you add questions and covert chapter numbers into points and make an application that calls them over 100?
Create a new NetBeans 8.2 Java 8 project called TestSimulator.
Add the eight classes from the UML class diagram in a package called “testsimulator” as shown below. Create a class stub for each class such as below:
public class ClassName { }
Add the necessary additional keywords for classes that inherit from interfaces or abstract classes.
Part 2:
Main menu Consult the UML class diagram and add implementation to the TestSimulator class as follows:
getSelection() method: • Print the following menu-based messages:
Welcome to the TestSimulator program menu.
Select from one of the following options.
(1) New test. (2) Test summary. (3) Exit. Enter your selection:
• Accept the choice from the user. • Ask the user to enter their choice again if a non-number is received.
main() method: • Add a loop that runs the getSelection() method until the user enters option (3). • Add a branching construct that prints a message regarding the user’s choice for each option.
• The program finishes normally after option (3) is selected.
Part 3: Question class
The Question class is an abstract class that represents one question for a test. It contains details about the question, but not much about the answers. This is because there are different types of answers (i.e.: multiple-choice versus true/false) and those details will be implemented elsewhere. Consult the UML class diagram and add implementation to the Question class based on these guidelines:
• The isAnswerCorrect() method is an abstract method. I.e.: It has no body.
• No further notes are given about the other members (fields, constructors and methods), so use the UML class diagram to guide your implementation.
Part 4: MultipleChoiceQuestion class The MultipleChoiceQuestion class adds extra functionality inherited from the Question class to represent one multiple-choice question for a test. It adds extra details about the answers. Consult the UML class diagram and add implementation to the MultipleChoiceQuestion class based on these guidelines:
• The isAnswerCorrect() method is overridden from the Question class. It returns true if “correctAnswer” and “chosenAnswer” are the same, otherwise false.
• The constructor accepts “answer1”, “answer2”, “answer3” and “answer4” separately, but they are stored together as “answers” of type String[4]. • Field “chosenAnswer” takes a default value of ‘a’, which is the first answer. • No further notes are given about the other members (fields, constructors and methods), so use the UML class diagram to guide your implementation.
Part 5: TrueFalseQuestion class The TrueFalseQuestion class adds extra functionality inherited from the Question class to represent one true-false question for a test. It adds extra details about the answers. Consult the UML class diagram and add implementation to the TrueFalseQuestion class based on these guidelines: • The isAnswerCorrect() method is overridden from the Question class. It returns true if “correctAnswer” and “chosenAnswer” are the same, otherwise false. • Field “chosenAnswer” takes a default value of ‘true’, which is the first answer. • No further notes are given about the other members (fields, constructors and methods), so use the UML class diagram to guide your implementation.
Part 6: QuestionFinder interface The QuestionFinder interface provides the containsQuestion() method used in the QuestionBank and Test classes. It provides one method with the following definition: public default boolean containsQuestion(String questionID, ArrayList questions) { ... } The method returns true if the “questionID” is found in the “questions” ArrayList, otherwise false. This method is implemented as a concrete method. Concrete methods are allowed in interfaces provided that the default keyword is used. This is a new feature added to Java version 8. 7 Implement the containsQuestion() method in the QuestionFinder interface based on the above guidelines.
Trending now
This is a popular solution!
Step by step
Solved in 10 steps with 1 images