CIS2168 Fall 2014

Assignment 3

Student Database

Due Date: 09/19/2014 Friday 11:59PM

Database is an organized collection of data. In this assignment, you will implement a simple database that permeanntly stores student information. That means you will have to store the student information to a file so that you can still find your data after you restart your computer.

We can still hold all student information in a Sorted Bag. When we open a database, we read the student records into a bag. We manipulate the Bag to insert, and remove student records. When we close the database, we write the Bag into the database file in JSON (JavaScript Object Notation) format. You can learn more about JSON here. You can verify the content of the file at http://jsonlint.com/ . You need to add json-simple-1.1.1.jar to parse the JSON. Add the JAR file to your project.

NetBeans Project: You can download the NetBeans Project here.

Here are the database operations that your program must support in order to manipulate the contents of the database.

You have to implement this Database Interface. Don't worry. I implemented create, open, close metods. You have to implement get, remove, find and insert methods. Database Implementation is here.

Student class has id, first name, last name and date of birth. You can add phone number and email. Student class is given here. Student class uses the Date class we created. You can download the Date class here.

Your main program display the following menu:

Welcome to Student Database

0) Quit the program
1) Create a new database
2) Open an existing database
3) List all students
4) Add a new student
5) Find students by name
6) Remove a contact by ID
7.Close the Database
-> Enter choice ->

 

The main menu class is given here. The InputHelper class is used in to receive user inputs. You can find it here.

Make sure you test following requirements:

  1. You have to open a database before you use it.
  2. You cannot open more than one database at the sametime.
  3. Close the database to write the changes to database.
  4. If you quit the program before you close the databse, changes will be discarded.
  5. When you find students by name, it will display every student whose first name or last name matches the keyword.

What will you learn

Array based collection, Iterator, Comparable, Keyboard input, File I/O, JSON

What to Submit

A single zip file called Assignment3_firstname_lastname.zip, where firstname is your first name, and lastname is your last name. In this zip file, put:
  1. Java source
  2. A README file with:
  3. Submit this zip file to Blackboard