class Microwave { Food contents; double seconds; Microwave() { this.contents = null; this.seconds = 0.0; } void enterTime(double seconds) { this.seconds = seconds; } double getTime() { return this.seconds; } void pressCookButton() throws Exception { if (this.seconds == 0) { throw new Exception("No time entered!"); } if (this.contents == null) { throw new Exception("Nothing in microwave!"); } this.contents.heat(this.seconds); this.seconds = 0.0; } void insert(Food f) throws Exception { if (this.contents != null) { throw new Exception(); } this.contents = f; } Food remove() throws Exception { if (this.contents == null) { throw new Exception(); } Food f = this.contents; this.contents = null; return f; } }