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.
![TestSimulator
TestSummary
+ main ( args : String[] ) : void
+ getselection () : int
+ FILENAME SU MMARY = "test-summary.txt" :
String
main() uses
- TEST_REPORT_FIELDS = 4: int
- chapterQuestionsAnswered : int[8
chapterQuestionsCorrect : int[8]
+ TestSummary ()
+ summarise Performance () : void
+ reportPerformance (): void
main() uses
main) uses
<<Interface>>
QuestionFinder
+ containsQuestion ( questionID : String,
questions : Array List<Question>): boolean
realises
realises
Test
QuestionBank
+ CHAPTERS : int[] {8, 9, 10, 11, 13, 14, 15, 16)
MULTIPLE_CHOICE_FILE = "multiple-choice-
questions.txt" : String
TRUE FALSE_FILE = "true-false-questions.txt" :
String
- questions : Array List<Question>
+ Test ( numQuestions : int, questionBank:
QuestionBank)
+ getlength () : int
-selectQuestions ( numQuestions: int,
------
constructor and
selectQuestions() use
- MULTIPLE_CHOICE_FIELDS = 8: int
- TRUE_FALSE_FIELDS = 4: int
questions : Array List<Quest ion>
+ Quest ionBank ()
+ getlength () : int
+ getQuestion ( index : int ): Question
+ loadMultipleChoiceQuestions () : void
+ loadTrueFalseQuestions () : void
QuestionBank questionBank)
+ runTest () : boolean
+ showTestSummary () : void
+ save TestResult (): void
questions
questions
Question
Question](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5c3ae1d8-fc97-42ff-9e6a-92cf5f608592%2F236d20aa-3b18-4c53-a23d-12b2839899ec%2Fw73es4_processed.png&w=3840&q=75)
![questions : Array List<Quest ion>
+ Test ( numQuestions : int, questionBank :
QuestionBank )
+ getlength () : int
- selectQuestions ( numQuestions: int,
+ CHAPTERS : int[] {8, 9, 10, 11, 13, 14, 15, 16)
MULTIPLE_CHOICE_FILE = "multiple-choice-
questions.txt" : String
TRUE_FALSE_FILE = "true-false-questions.txt" :
-----.
constructor and
String
MULTIPLE CHOICE_FIELDS = 8: int
selectQuestions) use
QuestionBank questionBank)
+ runTest () : boolean
+ showTestSummary (): void
+ save Test Result () : void
TRUE FALSE_FIELDS = 4: int
- questions : Array List<Question>
+ Quest ionBank ()
+ getlength (): int
+ getQuestion ( index : int ): Question
+ loadMultipleChoiceQuestions () : void
+ loadTrueFalseQuestions () : void
questions
questions
Question
- questionID: String
- chapterNumber: int
- questionText : String
+ Quest ion ( questionID: String, chapterNumber
: int, questionText : String)
+ isAnswerCorrect () : boolean
+ getQuestionID () : String
getChapterNumber () : int
+ getQuestionText () : String
inherits
inherits
MultipleChoiceQuestion
answers : String[4]
TrueFalseQuestion
correctAnswer: char
- chosenAnswer: char
+ Mult ipleChoice Quest ion ( questionID: String.
chapterNumber: int, questionText: String,
answerl: String, answer2 : String, answer3:
String, answer4 : String, correctAnswer: char )
+ isAnswerCorrect (): boolean
+ getAnswers () : String[]
- correctAnswer: boolean
- chosenAnswer: boolean
+ TruefalseQuestion ( questioniD: String,
chapterNumber: int, questionText : String,
correctAnswer: boolean )
+ isAnswerCorrect () : boolean
+ getCorrectAnswer () : boolean
+ getChosenAnswer () : boolean
+ setChosenAnswer ( chosenAnswer: boolean ):
+ getCorrectAnswer (): char
+ getChosenAnswer (): char
+ set ChosenAnswer ( chosenAnswer: char ):
void
void](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5c3ae1d8-fc97-42ff-9e6a-92cf5f608592%2F236d20aa-3b18-4c53-a23d-12b2839899ec%2Fz5qk2bu9_processed.png&w=3840&q=75)

Trending now
This is a popular solution!
Step by step
Solved in 10 steps with 1 images









