Question: Using java to program Background: For this assignment, you will develop an object-oriented program for e.xam questions. The types of questions are shortanswer questions, fillintheblank

Using java to program

Background: For this assignment, you will develop an object-oriented program for e.xam questions. The types of questions are shortanswer questions, fillintheblank questions, and multiple choice questions. You will test your design by creating an e.xam, taking the ex.am, and printing the results of you taking the ex.am.

Your assignment is as follows: Create a Question class that constructs objects from a question String. This class resembles shortanswer questions which need to be graded by a human since the answer involves natural language. The class should have an instance method that prompts the user with the question and stores their answer. The class should also have an instance method that prints the question and the users answer.

Create a FillInTheBlankQuestion clas. It should construct objects from a question and its fillintheblank answer (both in the form of strings). Create the same methods you created for the Question class, but this time also print the correct answer when their answer was incorrect.

Create a MultipleChoiceQuestion. It should construct objects from a question String, an array of Strings to be used as the multiple choices, and the index of the correct answer in the array. Create all the appropriate methods from the Question class. Modify the method that prompts the user with the question and stores their answer to also display the multiple choices. This class should also be able to print whether or not the users answer was correct. If their answer was incorrect, also print the correct answer.

To demonstrate your object oriented design, write a main method in a separate class to create an ex.am using the question classe, take the ex.am, and print the results of taking the ex.am. Put all of your classes in separate .java files for this assignment and adhere to the class design guidelines and code conventions of the textbook.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!