class Food { double grams; double doneness; String name; Food(String name, double grams) { this.name = name; this.grams = grams; this.doneness = 0.0; } void heat(double seconds) { this.doneness += seconds; } boolean isCooked() { return this.doneness > .9 * this.grams; } boolean isOvercooked() { return this.doneness > 1.1 * this.grams; } public String toString() { if (this.isOvercooked()) { return "burnt " + this.name; } else if (this.isCooked()) { return this.name; } else { return "raw " + this.name; } } }