Lab5


Lab5 - Extending the Museum


Lab #5: Volunteers at the Museum

In this lab, modify the Museum simulation which is included in the SimulationsPkg.2Oct.cs found in Chapters 23 and 24 of the Smalltalk-80 textbook. We will modify the Museum to have more people in the museum than just visitors. Add volunteers and staff.

Your simulation should keep track of the number of people in the museum at each time interval, where the number of people includes staff, volunteers, and visitors. Have your simulation be able to output the maximum number of people at any time. Hint: Either during the entry: method or on the simulation object's initialize: method, increment a count of people. At exit:, decrement the number of people.

To run the simulation provided, use the code below:

        | aSimulation |
        aSimulation := Museum  new startUp.
        [aSimulation time < 480] whileTrue: [aSimulation proceed].  "480 minutes, all day"
        Transcript show: 'Maximum: ', (aSimulation maximum printString) ; cr.

Note: If Squeak is stalling on the whileTrue: loop, you can exit it by pressing CTRL-Break simultaneously. The Break key is the right-most key on the top-most keyboard line.


Fileout your code as usual. (make sure you have previously filed in CrLfFileStream.cs and set it up as your concreteStream - see Lab2: Debugging for details)

You can now Turnin your code by going to the turnin page for your appropriate section:

http://minnow.cc.gatech.edu/cs2390w98a (Section A)
http://minnow.cc.gatech.edu/cs2390w98b (Section B)
http://minnow.cc.gatech.edu/cs2390w98c (Section C)
http://minnow.cc.gatech.edu/cs2390w98d (Section D)
http://minnow.cc.gatech.edu/cs2390w98e (Section E)
http://minnow.cc.gatech.edu/cs2390w98f (Section F)

You will be prompted for a user name and password. Your user name is your name as it appears on the CS2390 Home page. Your password is your 9 digit social security or Student ID number WITHOUT DASHES!.

Click on the Turnin new project link. Select Lab3 in the Assignment menu.

You will now paste the code into the text area of the turnin web page. Click on the Turnin button and you are done!

When you are done, EXIT FROM SQUEAK! Also, if you saved any files to C:temp, don't forget to delete them before you leave!




News Page | CS2390 Win'98 Home Page | CS2390 CoWeb | STABLE | BOOST
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 2/11/98; 1:32:23 PM