lispp5 - Programming Project#5 Databases Fall 2011 CMSC 420...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Fall 2011 Programming Project #5 — Databases CMSC 420 Hanan Samet This project involves a data base management system for the army, with data processing opera- tors typically found in the network model. The records in the data base correspond to members in the army. For each member the following information has been gathered: weight — in lbs. height — in centimeters sex — value m or f univ (ersity) — nil if none year — when entered service age — when entered service salary homestate married — value y or n kidnames — a list: nil if none The data for each member of the army is stored on the property list of the members name. There is also an atom with the name officers whose value is a list of the names of all of the officers. For example: (jones smith denton) . An example data base entry is shown in Figure 1. SMITH WEIGHT 120 HEIGHT 160 SEX F UNIV SMITH YEAR 1960 AGE 22 SALARY 20000 HOMESTATE IOWA MARRIED N KIDNAMES MARY JOHN Figure 1: Example database entry Given such a data base system there are two types of operations that you are to support. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
data base modification operations queries In addition to the records, we also have entities known as sets. In our case these sets are lists whose elements are names who share certain properties. For our purposes the sets correspond to rank. We shall assume 5 ranks. They are: general colonel major lieutenant private Note, that we assume that the set officers includes all ranks, including private (even though technically a private is not officer in army terminology). You are to provide routines to support the following data base modification operations: (store name proplist) An officer name name is entered into the data base with prop- erty values as given in proplist . proplist is a list of dotted pairs whose car is a property name and cdr is a property value. Note that name must also be added to the list officers if not already a member. (insert name setname) Inserts the officer with name name into set setname if not al- ready a member of the set. (removeofficer name setname) Removes the officer with name name from set setname if name is a member of the set. (deleteofficer name) Deletes the officer with name name from the data base. This consists of removal from the list officers as well as from all sets in which name is a member. (modify name prop value) Modify the property prop of officer name to be value . Some error checking of arguments must be implemented. For example, a name cannot be in- serted into a set unless it has been entered into the database, and the setnames given in insert and removeofficer must be a name of one of the 5 ranks above. Should the arguments be illegal, the function should return nil ; otherwise, any non- nil value can be returned (e.g., the set after insertion for the insert operation, but then you must watch for the case when the set is empty). Two types of query operations are to be supported.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

lispp5 - Programming Project#5 Databases Fall 2011 CMSC 420...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online