subject

Suppose that a university wants to show off how progressive itis and ends its long standing practice of gender-segregatedbathrooms on campus. However, as a concession to propriety, itmakes a policy that when a woman is in the bathroom only otherwomen may enter, but not men, and vice versa. On the door of everybathroom there will be a sign with a sliding marker that willindicate one of three possible states it is currently in: Empty
Women Present
Men Present
For our project we will complete two parts:
1. Using pseudocode, outline the following procedures:woman_wants_to_enter, man_wants_to_enter, woman_leaves, man_leaves.
2. Using C produce a working application that will address theabove problem and that will compile and run on cscacad and willutilize the above procedures.
For both of the above you may use whatever counters andsynchronization techniques you like.
Taken from a problem in Modern Operating Systems, 3e
Mandatory
1. Although you may use any IDE or environment you desire tocompose your program, it must be able to be compiled and run onCSCACAD or equivalent University system and must be written inC.
3. The program must execute for at least 20 cycles (a cycle isdefined as one iteration of a person entering the queue if unableto enter the bathroom, and/or entering the bathroom if eligibleand/or exiting the bathroom).
4. The program must contain the procedures woman_wants_to_enter, man_wants_to_enter, woman_leaves, man_leaves.
5. The program must display the following during its execution:the number of the cycle, the state of the bathroom (empty, occupiedby women and if so how many, occupied by men and if so how many, the status of the queue including whether it is empty or not and ifnot empty what genders are in queue and where their position is inthe queue).
6. The program may exhibit full automation (executes for a givennumber of cycles automatically without intervention), or manualoperation (the console operator inputs from the console to generateeach new person entering the queue, entering the bathroom orleaving the bathroom). If in manual operation the program shouldautomatically allow the next eligible person in the queue to enterthe bathroom in a fair fashion (no cheating).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
You know the right answer?
Suppose that a university wants to show off how progressive itis and ends its long standing practice...
Questions
question
Mathematics, 14.04.2020 22:27
question
Mathematics, 14.04.2020 22:27
question
Mathematics, 14.04.2020 22:27
Questions on the website: 13722363