CS14 - At-Home Programming Assignment 1


Read this assignment very carefully many times. You will be resonsible for everything on this page whether you read it or not


In this project you will write a program for a phone company. Your program will use a list of lists to maintain the database of phone numbers. The main list will refer to the area codes. The lists coming off of the main list will store the telephone numbers in that area code. Each phone number should store the prefix and suffix seperately. Here is an example illustration:



Your program should be able to support the following actions: There are many List templates available (for example, the Standard Template Library offers a list template class). However, for this assignment, when you use a linked list, it will be your own code so that you can practice your programming and learn the concepts thoroughly. You may however, use any variation of a linked list (double linked list, sentinals, etc) as long as it interfaces with the main functions provided.

Skeleton code provided

So that your program will interface with our testing environment for grading, you must adhere to the following specifications and use the skeleton code provided. If you deviate from the specifications and your program does not interface with our testing environment, you program will not be graded. To ensure that your code will interface correctly, DO NOT alter any of the code provided to you. Please only ADD to the code.

Structure

Your program will consist of 3 basic classes and I have provided you with the skeleton code for those classes. DO NOT make any additional classes. You only need these 3 classes. You must download these files and complete the code in them.

Function prototypes

You will write the following functions for your PhoneBook class to interface with the main function. This is in no way an inclusive list of the functions that you will need to write. This is simply the minimum amount of information that I need to give you so that your code will interface with the main testing function. For each function, please follow the specifications listed above. You must also write the following function for the AreaNode class.

Error checking

Please make sure to provide good error checking throughout. If an error occurs, i.e inserting a duplicate number or deleting a number that does not exist, print out an error message and return from the function. Do not exit! Make sure that your error message matches mine the in sample output EXACTLY.

Start Early!!

This project is most likely by far the largest programming assignment that you have ever been given and I am sure that it seems overwhelming. This project (along with every subsequent project you will be given this quarter) absolutely cannot be left until the last minute to complete. And, with the late penalty being a full letter grade per day, you don't want to turn your projects in late. Here is a quote from a previous quarter. Hopefully it will keep many of you from falling into the same situation...

Notes on grading

Grading programming assignments can be a very time consuming operation if programs cannot be automatically tested with a test function. I would like to stress again how important it is for your programs to work with the main functions provided. Your programs will be graded with main.cc. You will receive points for the test cases that your code passes. If your code does not interface with main functions provided, you will not receive any functionality points.

DO NOT, I repeat, DO NOT add anything to the main files that is necessary for your program to compile/function correctly. We will download a new copy of main.cc to test your program with.

Your output MUST match mine EXACTLY. This is my output. Notice that I print out error messages. You must ensure that your error messages match mine down to the whitespace. You need to determine if yours is exactly like mine by using the diff command. Do a man on diff for more information (type "man diff" at the command prompt). Basically, you need to run the following command in Linux: "diff youroutput.out main.txt" and if the files are the same, nothing will be printed to the screen (That is your goal). However, you don't have to get all test cases working, you can get partial credit. Make sure that the output matches exactly for the test cases that you are able to get working. To capture your output to a file, you can use the output redirection available in the Linux shell. You can redirect your output using > . To capture your output for this project, your command would look similar to this: "phonebook > youroutput.out" where phonebook might be the name of your executable and youroutput.out is what normally would have been printed to the screen. You will receive points for every test case that you get working. VERY, VERY IMPORTANT - you will NOT receive points for a particular test if the diff command fails for that test.

To gets points for tests, you must be able to pass previous tests before subsequent tests can be run. If for any reason you can not get a test case working but you are able to get subsequent tests working, you must ensure that your code doesn't seg fault! That way, you can receive points for subsequent test cases.

Much of the grading of your program will be based on not just getting code to do the necessary functions correctly, but on your actual coding. Be sure to use good programming where possible (use of classes, functions, good parameter passing techniques, error checking, encapsulation, object oriented programming). Make sure your program is user friendly.

You must use a makefile to compile your program and you must at least use the compilation flags -W -Wall -Werror -pedantic. Programs will be graded under linux on hill.cs.ucr.edu. Significant points will be taken off if your program does not compile with a makefile or if you code under Windows.

Suggestions to follow while coding

What to turn in

You should have turned in what you have thus far on our program at least 6 hours before the due date (by 2pm). Then continue to work on your program and turn in more current versions as you get them working. Ideally, you should have your project done well before the due date.

You must turn in all .cc and .h files and your makefile. Furthermore, you must turn in a file called readme.txt that states which test cases your program passes and which test cases your program fails. In addition, you must follow any guidelines and include any information that is stated on the main page about at-home programming assignments.

DO NOT, I repeat, DO NOT turn in any files that are not required for the final compilation of your assignment. Do not turn in your temporary .cc files or your saved/older revisions of your .cc files. If you turn in files that aren't required for your assignment, it hinders the grading processes. You will be docked points if you turn in extraineous files.

A reminder about collaboration on home programming assignments

Please remember, at-home programming assignments are not lab assignments and you may not team-code with your lab partner or any other individual. Limited collaboration may be acceptable, but programs must represent YOUR OWN original work from THIS quarter (meaning if this is your second time taking the course, you MAY NOT turn in ANY code written for a previous quarter). Sharing code or team-coding are strictly not allowed. Copying code from ANY source (any book, current or past students, past solutions, web, etc) is strictly not allowed even with citation. Collaboration may consist of discussing the general approach to solving the problem, but should not involve communicating in code or even pseudo-code. Students may help others find bugs. Your code MUST be unique -- the odds of randomly producing similar code is very low. Computing, like surgery or driving a car or playing golf, can only be learned by doing it yourself!