If you have not already done so, create a directory for this lab (and copy the lab 4 files into it. If you start off in your home directory you can do the following:
mkdir ~/cs112/lab4 cd ~/cs112/lab4 cp ~cs112/lab4/* .
main.c plane.c random.c random_test.c general.c sample_output plane.hAll the code in the plane.c, random.c, general.c and plane.h files can be used as is. All of the files (except plane.h which has been altered a little) is code from the book. The file main.c needs to be modified slightly to accommodate the change in implementation from arrays to linked lists. It is clearly marked WHERE those changes should be but we have not specified WHAT they need to be, that is up to you.
The include file plane.h also can be used as is. Your job is to write all the functions for linked list queue management as specified by the last seven prototypes in plane.h. Put these functions in a file named queue.c.
We have also provide the two files random_test.c and sample_output which you may use to test your simulation code. You should compile with random_test.c at first (not with random.h also or you will have duplicate functions) and execute your code with the 3 input parameters:
30 (units of time for simulation, an integer),You can then compare your output with that contained in the file sample_output. Once, you are able to reproduce this output, you should then compile with random.c (and not random_test.c) and try different input parameters. Note: the real numbers used for the expected number of arrivals and departures (per unit time) must not sum to a value larger than one.
0.47 (expected number of arrivals per unit time, a real), and
0.47 (expected number of departures per unit time, a real).
You also must create a makefile for this project.
main.c plane.c random.c general.c queue.c plane.h makefile
To submit your program(s) for grading, issue the command
at your UNIX prompt. This utility program will copy your programs for grading and an electronic mail message will be sent to you to acknowledge your submission. You may check the status of your submission at any time by typing the command
at your UNIX prompt. You will automatically receive an electronic mail message confirming the status of your lab submission.
You should also answer the questions below and submit them in hardcopy to the TAs at the beginning of Lab 5 on February 28 (no late submissions accepted).