CS 2213/2211
 Advanced Programming
 Spring 2005

 Recitation 13:  Hashing
    Week 13: Apr 19-21
 Due (on time): 2005-04-26  23:59:59
 Due (late):        2005-05-01  23:59:59

Recitation 13 should be submitted following directions at: submissions with deadlines
  • 2005-04-26  23:59:59 (that's Tuesday, 26 April 2005, 11:59:59 pm) for full credit.
  • 2005-05-01  23:59:59 (that's Sunday, 1 May 2005, 11:59:59 pm) for 75% credit.


Introduction: This recitation works on areas:


Overview: Suppose you are running a private parking lot in a large city. People often park without permission. The first time they park this way, you want to enter their license plate number into your computer, and put a tag on the car warning them not to park without paying. You want to be able to know when it is the second time they park, so that you can affix a large warning sticker across their windshield on the driver's side (almost impossible to remove) warning them that they will be towed the next time. You want to be able to know when it the third or later time they parked so that you can have them towed.

The license plate numbers will be in a file on your computer, along with a count of the number of times they parked without paying. Your program will first load this file into an array, using hashing for insertion. Then you will enter a list of license plates as they come up during the day, some old, some new, that need to be looked up in the array. At the end of the day, when you quit the program, it should write out the latest version of this license plate data.

When you enter a license plate number, the program should tell you how many times they have parked without paying.

In addition to entering a license plate number, you need to be able to delete an entry entirely (in case they finally paid for parking), and you need to be able to quit in an orderly way, so that the system can save its latest version to a file.


Details:


Sample interactive sessions:


What you should submit: Refer to the submissions directions and to deadlines at the top of this page. The text file that you submit should first have Your Name, the Course Number, and the Recitation Number. The rest of the file should have the following in it, in the order below, and clearly labeled, including at the beginning the appropriate item letters: a, b, c, etc.

 Contents of email submission for Recitation 13:

Last Name, First Name; Course Number; Recitation Number.

a. Source for files hash.h, hash.c, and license.c

b. Follow the sample session 1, without deletions.

c. Follow the sample session 2, with deletions.

Note: It's not required that your program have identical output to mine in the two sessions. There are a number of reasons why the output might differ.


Revision date: 2005-04-23. (Please use ISO 8601, the International Standard.)
Copyright © 2011, Neal R. Wagner. Permission is granted to access, download, share, and distribute, as long as this notice remains.