CPSC-102: Computing and Algorithms II
Programming Assignment 3
In this programming assignment, you will demonstrate your knowledge of
dynamic data structures (in particular, linked lists) by revising the
video database program from Programming
Assignment 1 to incorporate a dynamic data structure.
New Internal Requirements
For this assignment, you should replace your Database class with
another implementation which uses linked lists to organize lists
of videos. You should maintain the database as two separate
linked lists of videos: one for videos currently in stock,
and one for videos which have been checked out.
You may use any form of linked list which you desire; simple,
doubly-linked, dummy head nodes, etc.. You may declare additional
classes as desired in order to manage the linked lists.
Since linked lists are unbounded in size, the previous restriction
on the number of videos in the database is hereby revoked.
You should maintain each of your linked lists of videos in sorted
order, sorted in ascending order by title.
New Functional Requirements
Your program will be an extension of Programming
Assignment 1, and
thus should operate in the same manner as that assignment, unless
otherwise specified herein. In particular, this means that any
errors present in your submissions for Programming Assignment 1
should be fixed for this assignment.
The following new requirements should be implemented as well:
- The print database command should now offer the user
three options: print videos in stock, print videos checked out,
or both. The latter option would print both lists of videos,
one after the other. (You may implement this as three separate
options on your main menu, or one option with a submenu.)
- Each printed list of videos should appear
in sorted order. (Since your lists of videos are required to
be stored in sorted order, this should be no problem.)
- New options should be added to the main menu, allowing the user
to check out or return videos. Checking out a video should
change its availability status to false, and thus cause the video
to be deleted from one list and inserted into the other. Returning
a video should have the opposite effect.
Submitting Your Program
Before 11:59:59 p.m., Thursday, 20 August 1998 (7th Thursday), you
must email a single file to firstname.lastname@example.org
containing all source code files for your program, including a file
named Prog3.java containing a main method.
In addition, you must deliver to the instructor a printout of your
program files at the start of class on Friday, 21 August 1998 (7th
- Plan for the future! If your submission for Programming
Assignment 1 was well designed, the number of changes to classes
outside of the Database class should be minimal. In Programming
Assignment 4, you will be asked to replace the Database class with
an implementation of a different dynamic data structure; again,
changes outside of the Database class should be minimal. Design your
program with this in mind.
last updated: 30 July 1998