Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a default constructor that initializes the fields numEmployees ( integer ) , state ( string ) , and rating ( integer ) with the

Define a default constructor that initializes the fields numEmployees (integer), state (string), and rating (integer) with the default values 1, "Void", and 0, respectively.
Ex: If the input is 18 WV 5, then the output is:
Default values:
Number of employees: 1, State: Void, Rating: 0
After mutator methods:
Number of employees: 18, State: WV, Rating: 5
Note: The class's print() method is called before and after the input is passed to the setters.
EateryDirectory.java
1 ublic class Eatery {
private int numEmployees;
private string state;
private int rating;
Y* Your code goes here */
public void setNumEmployees (int eateryNumEmployees){
numEmployees = eateryNumEmployees;
}
public void setstate(string eaterystate){
state = eaterystate ;
}
public void setrating(int eateryRating){
}
rating = eateryRating;
public void print(){
}
System.out.println("Number of employees: "+ numEmployees +", state: "+ state +", Rating: "+ rating);
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_2

Step: 3

blur-text-image_3

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

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

Discuss how S. Truett Cathys values shaped Chick-fil-As operation.

Answered: 1 week ago

Question

1. How will you, as city manager, handle these requests?

Answered: 1 week ago

Question

1. Identify the sources for this conflict.

Answered: 1 week ago

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago