subject

Need help with Java code: In this exercise, we will create two distinct classes, a Meal and a Chef.

A Meal consists of three attributes - a name, the number of calories in the meal, and a recipe. The Meal class should include getter methods for all instance variables, and a toString that provides the name and the number of calories that make up the meal. For example, the toString for the meal Meal toast = new Meal("Toast", 100, "Put in toaster for 3 mins"); would return:

Toast, which has 100 calories."
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, their should be a getMealRecipe, getMealCalories and getMealName 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, which has 100 calories.
There is a Meal and Chef already prepared for you in the ChefTester class. Please add another meal and chef and print the toString and the meal recipe to the console.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 16:30
You may see the term faq on websites which stands for frequently asked questions this is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation ken has dipped many dark chocolate marshmallows (which you remember the metric system distance units in decreasing order: kilometers, hectometer, decameter, centimeter, millimeter) is an example of which type of mnemonic? a) poem b) acronym c) acrostic d) abbreviation !
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Match the following. 1. formatting that is applied when cell data meets certain criteria 2. borders with formats not found on the border tool 3. a shortcut bar that contains tools for commonly used formats 4. formats that can be applied to numbers conditional formatting custom borders format bar number formats
Answers: 3
question
Computers and Technology, 24.06.2019 21:30
The hybrid uses 144 to 158 volt batteries.
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
What does a trademark indicate about a product? a trademark is a sign, symbol, or short phrase that indicates the of a product or service. type the correct answer in the box
Answers: 1
You know the right answer?
Need help with Java code: In this exercise, we will create two distinct classes, a Meal and a Chef....
Questions
question
Mathematics, 19.04.2020 06:30
question
Mathematics, 19.04.2020 06:31
question
Mathematics, 19.04.2020 06:31
question
Mathematics, 19.04.2020 06:32
question
Mathematics, 19.04.2020 06:32
Questions on the website: 13722367