The agent should choose which pair of supplies to place out at random. The agent
ID: 3534003 • Letter: T
Question
The agent should choose which pair of supplies to place out at random. The agent periodically examines the table, and when it sees the ingredients have been taken, puts out a new random pair of ingredients.
Each smoker should periodically examine the table state for the desired ingredients, and remove them from the table when found.
Your program should generate a line of output each time a smoker changes state: starts smoking, stops smoking.
Terminate the threads and exit the program after the agent has enabled a total of 30 cigarettes to be smoked.
Explanation / Answer
//working code please rate
// the program is implemented using three files, smoker.cpp and smoker-main.cpp and smoker.h
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.