User Tools

Site Tools


lab7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lab7 [2019/03/07 01:29] francklab7 [2019/03/14 01:13] (current) franck
Line 7: Line 7:
 Each customer, when they arrive, looks to see what the barber is doing.  If the barber is sleeping, the customer wakes him up.  If the barber is cutting hair, the customer stays in the waiting room.  If there is a free chair in the waiting room, the customer sits in it and waits their turn.  If there is no free chair, the customer leaves. Each customer, when they arrive, looks to see what the barber is doing.  If the barber is sleeping, the customer wakes him up.  If the barber is cutting hair, the customer stays in the waiting room.  If there is a free chair in the waiting room, the customer sits in it and waits their turn.  If there is no free chair, the customer leaves.
  
-The waiting room is represented by the class WaitingRoom and the barber and the customers are represented by Barber and Customer threads.  The API of these classes can be found <a href="barber.+The waiting room is represented by the class WaitingRoom and the barber and the customers are represented by Barber and Customer threads.  The API of these classes can be found [[http://www.eecs.yorku.ca/course_archive/2018-19/W/4315/lab7/barber.api/index.html|here]].  Implement the classes WaitingRoom and Barber.  An implementation of the Customer class can be found [[http://www.eecs.yorku.ca/course_archive/2018-19/W/4315/lab7/Customer.java.txt|here]].  The sleeping barber app can be found [[http://www.eecs.yorku.ca/course_archive/2018-19/W/4315/lab7/Main.java.txt|here]].
-pi/index.html">here</a>.  Implement the classes WaitingRoom and Barber.  An implementation of the Customer class can be found [[http://www.eecs.yorku.ca/course_archive/2018-19/W/4315/lab7/Customer.java.txt|here]].  The sleeping barber app can be found <a href="Main.java.txt">here</a>.+
  
 Since randomization is used in some of the classes, different runs of the app may produce different outputs. Since randomization is used in some of the classes, different runs of the app may produce different outputs.
Line 60: Line 59:
 In the above run, customers 4 and 0 leave before getting a haircut since all chairs in the waiting room are occupied. In the above run, customers 4 and 0 leave before getting a haircut since all chairs in the waiting room are occupied.
  
-To receive feedback, submit your code using the submit command:\\+To receive feedback, submit your code **before** March 23 using the submit command:\\
 <code> <code>
 submit 4315 lab7 <name of class>.java submit 4315 lab7 <name of class>.java
lab7.1551922173.txt.gz · Last modified: 2019/03/07 01:29 by franck

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki