Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solve this using inheritance. and I am just the beginner so please use simpler codes as well so that I can understand....(up

Please help me solve this using inheritance.

and I am just the beginner so please use simpler codes as well so that I can understand....(up to arraylist)

great answer will be rated high.!

image text in transcribedimage text in transcribed

General Description: For this assignment you will be writing a program that can allow a user to take a Quiz. This assignment will utilize inheritance to design the classes Please use hw4 for the package name The Question Class: .A Question contains the text of the question and the correct answer to the question. NOTE: Answers can be stored as Strings o . A Question should have a default constructor to initialize the data fields to some default value .A Question should also have a constructor which takes as input the text of the question and the answer to a question .You may provide any other constructors as necessary. .A Question has the following behaviors. o Set and get the text of a question o Set and get the text of an answer to a question o Grade a question given a response to a question. This should take the user's answer as a parameter and return true or false depending on if the user got the question correct or not. o Implement a toString) method to print the question (not the answer) The MCQuestion Class: This class is a subclass of the Question class and will handie multiple choice questions with only one possible answer. .An MCQuestion should have an ArrayList where each element of the ArrayList is a possible choice for the question .An MCQuestion should have a constructor which initializes an empty ArrayList, as well as the question text. The answer will be initialized by one of the methods listed below. . An MCQuestion has the following behaviors o Add a choice to the list of choices. This method should have two parameters, the text of a possible answer as well as a boolean value. If the boolean value is true, this is the answer to t question and the correct letter (a, b, c, d, etc) should be assigned as the answer. If the value is false, this is not the correct answer to the question. o NOTE: The index of the ArrayList corresponds to the letter of the possible answer. Example: index 0 is "a", index 1 is "b", and so on. Override the toString0 method to show the question, and the list of possible answers (with corresponding letter before each answer) The FiBQuestion Class: . This class is a subclass of the Question class and will handle fill in the blank type questions A fill in the blank question has a constructor which takes ONLY the question in the following format: "Java is a_statically typed_ language o This constructor should take the question and parse out the answer (which is denoted using underscores.) o When the question is displayed it should be shown as "Java is a anguage .An FiBQuestion has the following behaviors o a private method to parse out the answer from the given

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

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago