CMSC 433 Lecture 10: Machine
Document Summary
* a machine is used to make a particular food. Each machine has a capacity: it can make. * that many food items in parallel; if the machine is asked to. * produce a food item beyond its capacity, the requester blocks. * each food item takes at least item. cooktimes seconds to produce. public class machine { // effectively static and final, so each instance of machine. // will use the same machinetype. public enum machinetype { fountain, fryer, grillpress, oven }; //your code goes here public final int capacity; public int currcap; private static object lock = new object(); * the constructor takes at least the type of the machine, * the food item it makes, and its capacity. * it with other arguments, if you wish. * constructor currently does nothing with the capacity; you. * must add code to make use of this field (and do whatever.