Steps:
1. Design your Question class
- Design your base and subclasses.
- Idenfity attributes and methods needed
2. Implement your Question class and subclasses
- Create and validate your base class
- Create and validate each sub-class
3. Create a separate program to create questions for the question bank.
Descripiton:
The purpose of this program is to introduce you to classes, subclasses, and inheritance in object-oriented programming.
For this project, you will create a study/quiz tool for students or instructors to enter, save, and retrieve different types of questions.
Question Types:
Create your Question class and sub-classes to fit the following requirements:
Question Types
1. simple flashcard
question
explanation
2. true/false
question
answer
explanation
3. multiple choice (fix the number of choices to four (4))
question
4 potential answers
answer
explanation
4. fill-in-the-blank
question (the FULL question without a blank)
answer
explanation
she gave us this little base example
/**
* Program Name: ___________
* Program Description:
* _________________________________
* _________________________________
* @author _________________________
* Date created: _______________________
* Last date modified: ____________________
*/
public class Question
{
private String question;
private String explanation;
public Question ()
{
question = "no question";
explanation = "no explanation";
}
public Question (String newQuestion, String newExplanation)
{
question = newQuestion;
explanation = newExplanation;
}
/***************************/
/** METHODS */
/***************************/
/** METHOD: setQuestion */
public void setQuestion (String newQuestion)
{
question = newQuestion;
}
/***************************/
/** METHOD: getQuestion */
public String getQuestion ()
{
return question;
}
/***************************/
/** METHOD: setExplanation */
// your code here...
/***************************/
/** METHOD: getExplanation */
// your code here...
}

New Topic/Question
Reply



MultiQuote




|