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, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is the term for water wave that is created by an underwater earthquake
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
While inserting images, the picture command is usually used to insert photos from a digital camera, and the clip art command is usually used to a.edit the sizes and other characteristics of photos that have been inserted. b.take a screenshot of an image and copy it to the clipboard for pasting. c.search for drawings or other images from a library of prepared pictures. d.make illustrations using lines and shapes that are easy to manipulate.
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
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
Spanish, 17.09.2019 22:00
Questions on the website: 13722359