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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

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
Transcribed Image Text: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
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
Transcribed Image Text: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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 10 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY