Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(in Java) In this exercise, we will create two distinct classes, a Meal and a Chef. A Meal consists of three attributes - a name,

image text in transcribed

(in Java)

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago