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() { if (this.doneness > .9 * this.grams) { return true; } else { return false; } } 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; } } }