Question
Java Program Topics: abstract class, interface, package, serializable, factory design pattern The Problem Suppose you are a software engineer working for a small software consulting
Java Program
Topics: abstract class, interface, package, serializable, factory design pattern
The Problem
Suppose you are a software engineer working for a small software consulting company called J Software. A high school has contracted your company to computerize their tests. Your company would provide software for the client to create tests that students can take on computers. Your project lead has analyzed the requirements and came up with some Java interfaces for type of questions the program must support and has assigned to you to implement the solution. The implementation of the interfaces will also be used to created the two programs that will be used by the school. The first program is for creating questions for tests and the second program is for administering the tests to students.
The Interfaces
The interface code is posted on blackboard. Download them and add them to your NetBeans project. Below are the interfaces provided for you:
Type of questions interfaces
o IMultipleChoiceQuestion
o ITrueFalseQuestion
o IFillInBlanksQuestion
o IShortAnswerQuestion
o IQuestion
Question set and question factory interfaces
o IQuestionSet (a collection of questions)
o IQuestionFactory (a factory to creating questions)
The IQuestionSet represents a collection of questions which serves as a test. For example, a user may create a set of questions named Midterm that has 20 questions in Java. The number of questions supported depends on the implementation.. For this exercise, you should use ArrayList as it will simplify the coding. The UML diagram above shows the operations IQuestionSet supports. You will use Serializable interface to support saving your question set.
To encourage you from using the implementation classes directory, you will implement the IQuestionFactory. The factory knows how to create the questions. Your program does not care what the name of the classes of the questions are. It only cares about the method provides by the interfaces. This is the concept of abstraction.
The interfaces should guide you in your implementation of the interfaces. The interfaces contain comments that describe what it is and what each method does. You will find the interfaces in the package com.jsoftware.test.api. You will add your implementation of the interfaces in the package com.jsoftware.test.impl.
The Programs
You will write two console programs that uses the interfaces and your implementation. The first program is named TestMaker which allows users to create test. The second program is named TestTaker lets a user loads an existing test and take it. The sample runs show how each program behaves. These programs should be in the package com.jsoftware.test.
To prevent your programs from being dependent on the question implementation, the only class it should know about is the question factory implementation. That makes your program very independent from the implementation. Changes to the names of implementation classes will not affect your program as it doesnt even care about their constructors. This makes your program much more maintainable.
The solution should implement multiple-choice question, true false question, fill in the blank question, short answer question question factory, and question set. Your program must compile and execute.
Provided code below:
IMultipleChoiceQuestion code:
ITrueFalseQuestion code:
IFillInBlanksQuestion code:
IShortAnswerQuestion code:
IQuestion code:
IQuestionSet code:
IQuestionFactory Code:
My run on net beans:
Sample run for Test Maker program:
Sample run for Test Taker:
Test taker sample run:
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