Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use DEEP COPY AND DEEP RETURNS. Also make sure NOT to go crazy like using Apache commons or Hasmaps or other things like that,

Please use DEEP COPY AND DEEP RETURNS. Also make sure NOT to go crazy like using Apache commons or Hasmaps or other things like that, this is a beginner computer science class.

image text in transcribed

ALSO PLEASE MAKE SURE THAT THE METHODS IN THE UML FILE ABSOLUTELY APPEAR IN THE CODE.

Finally please include, the FillInTheBlank.java, Quiz.java and the QuizTester.java file. Thanks so much!

Question 1: (FilllnTheBlank.java, Quiz.java, QuizTester.java) Consider the following aggregation relationship You are given the FillinTheBlank class which defines a fill-in-the- blank-type quiz question. Spend a few moments going over this class to understand how it works. A short tester class has also beentile: String provided to show you how it works. Add a copy constructor to this class that makes it easy to duplicate an existing question. Write JavaDocs for the FillInTheBlank class. Quiz -numQuestions int -quiz FillInTheBlank[] +Quiz) +Quiz(numQuestionsint, title String) +Quiz(in Quiz) setTitle(title String) *getTitle)String +setQuestion(index int, questionInFillInTheBlank) +getQuestion(index int) FillInTheBlank printText) printAnswers( +tostring)String Next, write a Quiz class that is made up of FillinTheBlank questions. The UML of this class is given A few hints: numQuestions simply keeps track of how many total questions make up the Quiz . The default constructor creates a quiz with 5 empty questions (nulls) and a title of your choosing. FillinTheBlank printTest() should display the title of the test and then all the -question String -answer String test questions (with question numbers) and printAnswers() should display only the answers (with question numbers). IF one of the questions has not yet been answered (i.e., it's still +FillinTheBlank(in null in the array) do not print anything. You can use an if statement to test for nulls. Try it out. +PillInTheBlank(q String, a String) FillinTheBlank) +setQuestion(q String) +setAnsver(q String) +getQuestion) String +getAnsver String toString) String setQuestion() and getQuestion() should make sure that the index numbers are appropriate and if not should do nothing toString() simply prints the quiz title and the number of questions the quiz can hold . Be sure to use DEEP COPY and DEEP RETURN where appropriate . If anything else is vague or uncertain use the discussion forum! My Quiz class is 75 lines without comments and with liberal spacing and curly braces Scanners should only appear in your tester class Write JavaDocs for the Quiz class. Finally write a quiz tester class that creates a simple 5 question quiz. Your tester should allow the user to create the questions. When the quiz has been created use the printTest() and printAnswers() methods to display the results

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions