Project 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

CSS-108: ​

Programming Technologies (Java) 


Project-1 
Deadline​
: February 15 (Saturday) 23:59 
100 points (5% from Total) 
Introduction 
The purpose of this project is to provide you with the opportunity to review some of the ideas and 
techniques you should be familiar with so far from this course, including text input, exceptions, 
manipulation of arrays and lists, and fundamental principles of object-oriented development. 
 
You should be able to complete the assignment within a week. Please ​start early​so that you have 
time to get your questions answered and review any areas in which you feel weak. The next project 
may be the continuation of this assignment, by adding GUI and more functionality; so keep this in 
mind while you design your project and its structure. 
 
Project Requirements Overview 
You will be implementing a simple Java program for creating 
quiz tests. The program shall operate in the command-line, 
read data from a given text file, create a quiz, and let the 
user take it. The user starts the quiz, answers all the 
questions, and gets results in the end. 
 
 
 
Program Design 
Good object-oriented design is required for this assignment. For example, all mutable data should 
be encapsulated in private fields, and all implementations must satisfy the requirements described 
below. If you need help or hints on how to design your program, you should ask in the office, by 
email, on Google Classroom, or during the classes, at least. 
 
Design Requirements 
Certain design requirements that you must follow are described below. 
 
1. Question class 
- Abstract class; 
- Any type of question will have a description (question text) and its answer (correct 
only); 
- Getter and setter methods. 
 
2. Test class 
- Extends the ​Question ​class; 
- Creates a multiple-choice test question; 
- Several possible options (only 4 for now), including single correct answer; 
- Labels are set automatically, starting from A, B, C, …. 
 
3. FillIn class​(Fill + In) 
- Extends the ​Question ​class; 
- Fill in the blanks question type; 
- Only one blank (at least for now), that is indicated by “​ {blank}​” string in a text 
file; 
- The answer must be case-insensitive (shall be checked by the ​Quiz ​class). 
4. Quiz class 
- Consists of list of questions; 
- Has a special method (​ static​) that loads questions from a text file, and creates a 
quiz; 
- Throws ​InvalidQuizFormatException​if the file format is not correct;  
- The s ​ tart ​method is responsible for the whole test process and its results. Note 
that it shuffles the order of questions and test question answers (options) each 
time the quiz is started. It also checks that the user input for ​Test ​questions is a 
valid one, i.e. one of A, B, ... 
 
5. InvalidQuizFormatException class 
- A special exception type thrown if the input file format is not correct; 
- Prints an appropriate error message. 
 
6. QuizMaker class 
- Has the m ​ ain ​method where a quiz is created and started; 
- The whole quiz starts as follows: 
> java QuizMaker JavaQuiz.txt
- Sample run of the program is attached at the end of this document. 
 
7. Quiz text file 
- The file name becomes the quiz name; 
- Each question separated by exactly one empty line; 
- Two types of questions: T ​ est ​or F
​ illIn​; 
- First line: question description; Second line: answer; 
- If only one answer line, then it is a ​FillIn ​type question; 
- In case there are multiple answer lines following the question description, this is 
​ est ​type question, the first answer being the correct one; 
a T
- Sample text file provided. Try creating your own quizzes and share with others. 
 
UML Class Diagram 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
You must meet all the design criteria described above. All the classes, variables, and methods 
must have exactly the same names and types. You may add extra fields and helper methods as well. 
 
Notes on Grading 
Make sure that every class does exactly what is described in the project requirements. Do not 
attempt to show some similar program downloaded from the Internet. It shall be considered as 
plagiarism, and get ZERO points. A fully tested and compiling class will be worth some points even 
if you do not finish the whole assignment. 
 
Any kind of extra improvements on the program (if the minimum is done) such as additional 
functionality, better design, or even GUI, etc. are welcome, but not required (not for bonus 
points, but just for fun :) 
 
Do NOT share your code with anyone.​It would be considered academic dishonesty, and strictly 
penalized. All the works submitted shall be inspected by a special program and reviewed by the 
instructors. Any kind of similarity, or not being able to answer questions on the project gives 
the instructor full right to penalize the work, and even cancel the results that have already been 
graded because of cheating issues. In simple words, the fact that you did not cheat yourself, or 
that you showed your work and it has already been graded, does not help you. All the sides 
involved in cheating (which is a crime) will be penalized. Again, do not share your code under any 
conditions. 
 
Although you are strongly encouraged to ask questions and have discussions on Google Classroom, 
make sure you do not share your code there as well, please. 
 
Turning In 
1. Collect all your work (six “​ .java​” files in total) into ​one zip​file, and name it as 
student_ID.zip​(Ex: 1​90107123.zip​); 
2. Turn in​via Google Classroom (in the assignment section, not as a comment or post); 
3. See your lab instructor to ​demonstrate your work​ , answer some questions, and get it graded. 
Your lab instructor may have a special schedule for project submission. 
 
Works that are not turned in will not be accepted. Submitted but not demonstrated works will not 
be graded. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Sample run of the Program: 
 

You might also like