CMSC 433 Lecture 10: Machine

116 views2 pages

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.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents