Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For NetBeans Java 8: The bookstore sells items to students, faculty/staff and the public. There are M visitors and N cashiers in the bookstore at

For NetBeans Java 8:

The bookstore sells items to students, faculty/staff and the public. There are M visitors and N cashiers in the bookstore at any given time. Visitors typically wander around shopping for items then line up to cash out. Cashiers service visitors on a first come first served basis. Write a program to synchronize the visitors and cahiers using semaphores and/or monitors. Follow the guidelines and instructions below:

- Prompt the user for the values of M and N. Assume an upper bound on M is 50 and N is 10.

- Assume the number of items each person carries to the cashier is between 1 and 6 and that they shop for between 50 to 75 time units per item.

- Assume it takes between 10 and 20 time units for a cashier to checkout an item.

- Show: the number of people shopping, the number of people waiting in the cashier line and the number of people being served.

Use the following guidelines:

Proper use of threads/semaphores

Master process functions correctly

Visitors function correctly

Cahiers function correctly

Proper graphical display of numbers identified in 4 above

Proper shutdown all threads exit properly

Comments in code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions