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 05:00
Modern businesses use different technologies to accomplish work tasks
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
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, 21.08.2019 19:30
Questions on the website: 13722361