Given the four java programs (Semaphore.java, SleepUtilities.java, Factory.java, Philosopher.java) below and also included with this email, compile and run the code as is. Which of the four java files has the main()?

computer science

Description

Given the four java programs (Semaphore.java, SleepUtilities.java, Factory.java, Philosopher.java) below and also included with this email, compile and run the code as is.  Which of the four java files has the main()? Copy and paste a screenshot of your running code:

(15 points) Then change the Philosopher thinking() to have a longer nap time, and eating() to have a shorter nap time.  Compare the results and draw conclusions.  

(15 points) Then after doing the above, change the nap times to their opposites: thinking() will now have a shorter nap time, and eating() will now have a longer nap time.  Copy and paste your modified code and results demonstrating your conclusions.

(20 points) Next, modify the appropriate java program so that the number of Semaphores is greater than the number of Philosophers and both use ArrayLists instead of arrays.  Modify the rest of the code in this java program accordingly to match the new data type and new numbers.  Compare the results and draw conclusions. Copy and paste your modified code and results demonstrating your conclusions:


Instruction Files

Related Questions in computer science category