This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Programming Systems Design CSCI 455 FALL 2009 Dr. K. Narayanaswamy Programming Assignment # 9 Due Date: 11/22/2009 (11:59:59 p.m.) Goal This assignment has all the same external requirements as Assignment 8, but we require you to implement the database as a collection of CLASS objects using LINKED LIST implementation, rather than arrays. Like Assignment 8, Assignment 9 will allow you to add students and delete students from the collection. The main difference is that you will program the database using linked list implementation. Task The program will manage a database of Student objects. As in Assignment 5, 6, 7, and 8 the following are the attributes of a student: • Last name: a string with only alphabetic characters. For formatting purposes, you may assume the names would be no longer than 15 characters; • First name: a string with only alphabetic characters. For formatting purposes, you may assume the first name would be no longer than 15 characters; • Social Security Number: a string. The social security numbers you accept must be 11 characters, with digits in positions 1, 2, 3, 5, 6, 8, 9, 10 and 11; and the “-“ in positions 4 and 7. • Phone Number: a string. A valid phone number will be of length 13, and will contain characters “(“ in position 1, “)” in position 5, and “-“ in position 9. All other characters must be digits. • Age: an integer. You may assume this field will always be an integer, but the age must be a positive integer. Your program will support the following single character commands in a main command loop: “I” or “i” (Import Command) Prompts the user for a file name, and will initialize the database from the student data in that file. That means that existing database contents will be wiped out completely and re-initialized when this command is executed. The data in the linked list must be maintained in sorted order – sorted 1 by social security number. The command should check for and report errors as the input file is processed. The format of the data and error checking requirements are identical to that in Assignment 5, 6, 7, 8. In all cases, IF there are any problems with the input, you should report the problem to the terminal to make the user aware with a line number on which the problem arises. You should also specify what action was taken with the input. You may assume the input will have the above items in the order stated in the input file. You do not have to do error checking beyond what is indicated explicitly in the assignment requirements. “A” or “a” (Add Command) Add a Student to the database you are maintaining – your program should prompt for each of the student attributes (such as social security number, last name, first name, phone, and age). Make sure that the attributes provided as values satisfy the requirements – e.g., social security number must be valid, age must be positive, and so on. Once all the data is validated, your program should add the new student to the existing database if there is no duplicate social...
View Full Document
This note was uploaded on 12/08/2009 for the course CSCI 455X at USC.