Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
