Answered step by step
Verified Expert Solution
Link Copied!

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
Help/FAQ
Victor
CHALLENGE
ACTIVITY
7.5.2: Initialization and constructors.
528040.3489528.93zay7
Jump to level 1
Define a default constructor that initializes the fields rating (integer), state (string), and owner (string) with the default values -1, "Void", and "Unstated", respectively.
Ex: If the input is 4TN Gus, then the output is:
Default values:
Rating: -1, State: Void, Name: Unstated's Deli
After mutator methods:
Rating: 4, 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 setRating(int mealEstablishmentRating){
rating = mealEstablishmentRating;
}
public void setState(String mealEstablishmentState){
state = mealEstablishmentState;
}
public void setOwner(String mealEstablishmentOwner){
owner = mealEstablishmentOwner;
1
2
image text in transcribed

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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

Evaluate three pros and three cons of e-prescribing

Answered: 1 week ago

Question

Be familiar with the five basic ways to manage demand.

Answered: 1 week ago