Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java// please use the code provided ! Thank you! Jump to level 1 In the class definition, initialize the private fields numEmployees (integer), owner (string),

Java// please use the code provided ! Thank you!
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Jump to level 1 In the class definition, initialize the private fields numEmployees (integer), owner (string), and rating (integer) with the default values 1, 'Unspecified; and 0 , respectively: Ex: If the input is 20 Del 3 , then the output is: Default values: Number of employees: 1, Name: Unspecified's Diner, Rating: 0 After mutator methods: Number of employees: 20, Name: Del's Diner, Rating: 3 Note: The class's print) method is called before and after the input is passed to the setters: Note. The class's print 0 method is called before and after the input is passed to the setters Check Next level Number of employees: 20, Name: Del's Diner, Rating: 3 Note: The class's print0 method is called before and after the input is passed to the setters: puotic vola setNumtriptoyees(int meattstabitsnmentNumtmptoyees) 1 \} numEmployees = mealEstablishentNumEmployees; public void setowner(String mealEstablishmentowner) f \} owner = mealEstablishmentOwner; public void setRating(int mealEstablishmentRating) \{ rating = mealEstablishmentRating; \} public void print() f System. out.println("Number of employees: " + numEmployees + ", Name: " + owner + "'s Diner, Rati 3 Check Next level Note: The class's print() method is called before and after the input is passed to the setters \begin{tabular}{|l|l|} \hline MealEstablishment.java & MealEstablishmentDirectory.java \\ \hline \end{tabular} 10111213141516171819202122232425 System,out.println("Default values: "); favoriteMealEstablishment. print O; newNumEmployees = scnr. nextIntO; newOwner = scnr. next(); newRating - scnr. nextInt() favori teMealEstablishment. setNumEmployees(newnumEmployees); favoriteMealEstablishment. setOwner(newOwner); favoriteMeatEstablishment. setRating(newRating); System, out.println("After mutator methods: "); favoriteMealEstablishment.print (; Check Noxt level

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago