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, 21.06.2019 15:30
Some of the items below indicate the steps required to move a slide to a different location in a presentation. select those steps and indicate the order in which they should be performed to move the slide. (for example, if an item describes what you do first, select 1.) included in the list are items that are not part of the process. for these items, select n/a, an abbreviation for not applicable. 1 — first 2 — second 3 — third 4 — fourth 5 — fifth 6 — sixth n/a — not applicable drag the slide to the desired place. enter the slide position desired. hold the mouse button down. select move from the tools menu. select the slide. switch to the notes view.
Answers: 3
question
Computers and Technology, 21.06.2019 20:50
Write a method in the heapintpriorityqueue class called merge that accepts another heapintpriorityqueue as a parameter and adds all elements from the other queue into the current queue, maintaining proper heap order such that the elements will still come out in ascending order when they are removed. your code should not modify the queue passed in as a parameter. (recall that objects of the same class can access each other's private fields.)
Answers: 2
question
Computers and Technology, 22.06.2019 03:40
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Does read theory have answers keys ?
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
Biology, 09.04.2021 05:50
question
Chemistry, 09.04.2021 05:50
question
Mathematics, 09.04.2021 05:50
question
Mathematics, 09.04.2021 05:50
question
Spanish, 09.04.2021 05:50
question
Physics, 09.04.2021 05:50
question
Chemistry, 09.04.2021 05:50
Questions on the website: 13722367