Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please provide a complete code please,,im the beginner so i want to analyze the complete code and try to understand it.(codes with detailed comment are
please provide a complete code please,,im the beginner so i want to analyze the complete code and try to understand it.(codes with detailed comment are my favorite..)
for customized question and answer in this assignment you can just put some random stuff. And just to emphasize again, I am a beginner, the technique I learned so far are up to arrayliist, I did not learn about list.... so please solve this as simple as possible..
Again, good answers will be rewarded and rated!!!
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started