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 01:30
How will you cite information that is common knowledge in your research paper?
Answers: 1
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
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
Social Studies, 22.07.2019 00:00
question
Mathematics, 22.07.2019 00:00
Questions on the website: 13722363