A Meal consists of three attributes - a name, what course the meal falls under, and the number of servings in the meal. The Meal class should include getter methods for all instance variables( e.g. getName, getCourse, and getNumberOfServings), and a toString that provides the name and the course of the meal. For example, the toString for the meal Meal toast = new Meal("Toast", "Breakfast", 1); would return: Toast (Breakfast) The Chef class also has three instance variables - the chef's name, the name of the restaurant they work at, and their best meal. Their best meal should be a Meal object. The Chef class should have getter methods for all instance variables, as well as getter methods for each instance variable of their meal. For example, there should be a getMealName, getMealCourse and getMealServings getter methods to access information about the meal. The Chef class should also have a toString that when printed returns the name of the chef, the restaurant they work at, and the meal that they are best known for: Chef Karel works at Chuck E Cheese and is best known for Toast (Breakfast) There is a Meal and Chef already prepared for you in the ChefTester class. Add another meal and chef and print them to the console. Be sure to test all of your accessor methods, too!



Answer :

Other Questions