Answered step by step
Verified Expert Solution
Question
1 Approved Answer
zyBooks catalog Help / FAQ Victor CHALLENGE ACTIVITY 7 . 5 . 2 : Initialization and constructors. 5 2 8 0 4 0 . 3
zyBooks catalog
HelpFAQ
Victor
CHALLENGE
ACTIVITY
: Initialization and constructors.
zay
Jump to level
Define a default constructor that initializes the fields rating integer state string and owner string with the default values "Void", and "Unstated", respectively.
Ex: If the input is Gus, then the output is:
Default values:
Rating: State: Void, Name: Unstated's Deli
After mutator methods:
Rating: State: TN Name: Gus's Deli
Note: The class's print method is called before and after the input is passed to the setters
MealEstablishment.java
MealEstablishmentDirectory.java
public class MealEstablishment
private int rating;
private string state;
private String owner;
Y Your code goes here
public void setRatingint mealEstablishmentRating
rating mealEstablishmentRating;
public void setStateString mealEstablishmentState
state mealEstablishmentState;
public void setOwnerString mealEstablishmentOwner
owner mealEstablishmentOwner;

Step by Step Solution
There are 3 Steps involved in it
Step: 1

Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2

Step: 3

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