The George Washington University
School of Engineering and Applied Science
Department of Electrical Engineering and Computer Science
CSci 51 -- Spring 1999 -- Project #9
Due Date: start of class, Thursday, April 29, 1999 (makeup day)
Final Deadline - No Late Projects Can Be Accepted!

This project ties together what you've done in Projects 6, 7, 8 into a "real time" simulation program that emulates the large trailer-mounted speed-monitoring displays we sometimes see on the highways.

In the Speed_Monitor package of Project 7, the procedure DeliverSpeed generated a random speed and a random arrival time, but delivered the results immediately to the calling program. This project provides a more realistic simulation of the radar unit.

Modify the DeliverSpeed procedure so that instead of returning immediately, it will wait for the indicated number of seconds and then return the values. This is very easy: if the random arrival time is 3.0, a simple statement DELAY 3.0; does the trick. Just add this statement to the end of the procedure just before it returns; see the Smiley program in Chapter 3 for an example. To provide for a shorter run of the program, change the random number generator so the arrival intervals do not exceed 5 seconds.

Now modify the main program so that when it receives a new set of values from DeliverSpeed, it displays the speed in large digits on the screen and logs the lines like

Time 12:40:17, Speed 57, Class 3

into a file instead of on the screen. Because the speed procedure is now waiting a few seconds, each speed output to the screen will stay a few seconds, then change to the new speed. To provide for a shorter program run, survey only the first 20 arriving cars.

In your project submission, add the contents of your output file into the turnin script.