Corrections, clarifications, and other announcements regarding this programming assignment will be found below.
In this assignment you will be using an array to implement an unordered list of structures. The list will have some very basic functionality (add, delete, update, print).
The goals of this assignment are to gain experience:
Start with the code given in the file studentDB.cpp, which you can find at:
Note you can copy the file by saving it from the link above or using the Linux cp command on the lab computers.
Implement a basic database containing student records. The database will be an unordered list implemented as a fixed-size array of 5000 elements. Each element of the array will be a structure containing the following student information:
Note: you must use an array to implement your database (e.g., you may not use a vector).
The program will use console input and output (cin and cout). Your main function will read user commands from the console (cin) and process the student database accordingly. Each command will be on a separate line. The commands are:
A brief sample execution of the program is given below (both user input and the resultant output are shown):
Enter your commands at the > prompt: > a 123456 4 3.0 > d 987654 error - student 987654 not found > a 987654 20 3.68 > p 123456,4,3 987654,20,3.68 > u 123456 A 3 123456,7,3.42857 > d 987654 > p 123456,7,3.42857 > q quit
You must implement the following functions:
Important note: The parameters listed in the functions above are not exhaustive. You can (and should) pass more information to the functions than what is listed. You also can (and will probably want to) create more functions than the ones listed.
Your program should give reasonably informative error messages (for example, "error - student 987654 not found" is reasonable, whereas simply "error" is not). Some situations for which you will need to give error messages have been mentioned above.
You can assume that all commands will have the correct format, that is, that any command we use to test your program will start with one of the acceptable characters and that commands expecting additional information will have them and they will be of the correct type. You will, however, need to check that values are in the appropriate range. For example, your program does not need to be able to handle the command "u 987654 AB 3.5" but it should handle "a 123 20 2.3" and "u 123456 I 4". Your program should handle these error situations by printing out a reasonable error message and going on to the next command.
Make sure your code follows the style and commenting standards used in CS 302 and CS 367. Note: the commenting standards use javadoc comments for class, method, and constructor headers. You do not need to use javadoc comments in your c++ programs for CS 368; however, your comments should include the same information as the javadoc comments. For example, your function header comments should include a description of what the function does, the name and a short description of each parameter, and a description of the return value.
Electronically submit the following file to your in "handin" directory by the due date and time (late policy):
Please turn in only the files named above. Extra files clutter up the "handin" directories.
© 2012-2013 CS368 Instructors