Computers and Technology

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).

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:30, mem81
How can you repin an image on your pinterest pin board a. click on the "repin" button b. click on the "add pin" button c. click on the "upload a pin" button d. click on the "save pin" button.
Answers: 2
image
Computers and Technology, 23.06.2019 08:00, hernandez09297
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
image
Computers and Technology, 23.06.2019 09:50, tatumleigh04
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, abelxoconda
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
Do you know the correct answer?
Suppose that a university wants to show off how progressive itis and ends its long standing practice...

Questions in other subjects:

Konu
Mathematics, 12.04.2021 18:30
Konu
Mathematics, 12.04.2021 18:30
Konu
Mathematics, 12.04.2021 18:30