
The George Washington University
School of Engineering and Applied Science
Department of Electrical Engineering and Computer Science
CSci 51 -- Spring 1997
Project #9
Due Date: start of class, May 1, 1997 ("designated Monday")
The University wants you to spend exam period studying for exams,
so we cannot accept late projects.
This project counts double, that is, as two projects (9 and 10)
This project uses material through Chapter 8, and also depends on your modified Simple_Dates package from Project 8.involves setting up a database for your audio compact discs (CDs). Attached is the source code for an interactive user interface program, My_CD_Manager, and the spec and body of a package Compact. My_CD_Manager, in operation, looks something like this:
Select one of the operations below. C Clear the databas R Read database from disk W Write database to disk A Add CD record to database D Delete CD record from database F Find a CD record in the database P Display all records in the database Q Exit the program Please type a command, then press Enter > a Thank you for correct input. A entered; here we'd add
You'll find it easiest to do the project step-by-step, as follows:
Step 1: Compile these three programs. Then link My_CD_Manager and run it, just to see how it behaves. When you look at these source files, you'll discover that
The rest of your project is to complete the package body and the interactive program.
Step 2: Implement the following operations in Compact and tie them into My_CD_Manager:
ReadDatabase DisplayDatabase
We will provide a test data file compact.dat. You will be able to test these operations by running My_CD_Manager, entering an R command, then a P command.
Step 3: Now implement the operations
Put WriteDatabase AddDisc
so you can read in the data, add a few AddDisc transactions, then display and write the database to disk. You can then examine the disk file with vi or cat.
Step 4: Complete the other operations in the database package and tie them into My_CD_Manager.