} } 1. The following two classes are used to help solve part A and B of this problem. } } /**The class SingleTable represents a table at a restaurant.*/ public class SingleTable { /** SingleTable has a zero parameter constructor */ public SingleTable () { /implementation not shown */ /** Returns the number of seats at this table. The value is always greater or equal to 4. */ public int getNumSeats () { /* implementation not shown */ /** Returns the height of this table in centimeters. */ public int getHeight() { /* implementation not shown */ /** Returns the quality of the view from this table */ public double getViewQuality() { } /** implementation not shown */ /** Sets the quality of the view from this table */ public void setViewQuality (double quality) { /** implementation not shown */ //there may be other constructors, fields, methods not shown /**Restaurant represents all the tables at a restaurant*/ public class Restaurant ( public ArrayList tableList; //there may be other constructors, fields, methods not shown /** Calculates and returns the average view quality of all of the tables in the tableList field */ public double getAverageView() { } /** implementation not shown */ Part A) Write a complete class CombinedTable that extends SingleTable This class represents a table that has been made by combining two single tables together. In order to get full credit, your class must contain the following: . . A constructor that takes two Single Tables as Parameters o You should store these paramters as private class fields An override of getNumSeats - A combined table can seat a number of customers that is two fewer than the total number of seats in its two SingleTableObjects (to account for seats lost when the tables are pushed together). . An override of getViewQuality o If the two tables are the same height, the view quality is the average of the view quality of the two single table. o If the two tables are not the same height, the view quality is 10 units less than the average view quality of the two single tables. Part B) Write the getAverageView method from the Retaurant class.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Alert dont submit AI generated answer.

Free Respons question Practice from CSA. I need help.
 
}
}
1. The following two classes are used to help solve part A and B of this problem.
}
}
/**The class SingleTable represents a table at a restaurant. */
public class SingleTable {
/** SingleTable has a zero parameter constructor */
public SingleTable () {
/* implementation not shown */
/** Returns the number of seats at this table.
* always greater or equal to 4. */
public int getNumSeats () {
/* implementation not shown */
The value is
smalala msino tate admsmo how way to Us world acoll
/** Returns the height of this table in centimeters. */
public int getHeight() {
/* implementation not shown */
/** Returns the quality of the view from this table */
public double getViewQuality() {
/** implementation not shown */
Part A) Write a complete class CombinedTable that extends SingleTable
This class represents a table that has been made by combining two single tables together. In
order to get full credit, your class must contain the following:
•
.
A constructor that takes two Single Tables as Parameters
。 You should store these paramters as private class fields
An override of getNumSeats - A combined table can seat a number of customers that is
two fewer than the total number of seats in its two SingleTableObjects (to account for
seats lost when the tables are pushed together).
• An override of getViewQuality
o
If the two tables are the same height, the view quality is the average of the view
quality of the two single table.
o If the two tables are not the same height, the view quality is 10 units less than the
average view quality of the two single tables.
Part B) Write the getAverage View method from the Retaurant class.
}
/** Sets the quality of the view from this table */
public void setViewQuality (double quality) {
}
/** implementation not shown */
//there may be other constructors, fields, methods not shown
/**Restaurant represents all the tables at a restaurant*/
public class Restaurant {
public ArrayList<SingleTable> tableList;
//there may be other constructors, fields, methods not shown
/** Calculates and returns the average view quality of all of the
* tables in the tableList field */
public double getAverageView() {
/** implementation not shown */
}
Transcribed Image Text:} } 1. The following two classes are used to help solve part A and B of this problem. } } /**The class SingleTable represents a table at a restaurant. */ public class SingleTable { /** SingleTable has a zero parameter constructor */ public SingleTable () { /* implementation not shown */ /** Returns the number of seats at this table. * always greater or equal to 4. */ public int getNumSeats () { /* implementation not shown */ The value is smalala msino tate admsmo how way to Us world acoll /** Returns the height of this table in centimeters. */ public int getHeight() { /* implementation not shown */ /** Returns the quality of the view from this table */ public double getViewQuality() { /** implementation not shown */ Part A) Write a complete class CombinedTable that extends SingleTable This class represents a table that has been made by combining two single tables together. In order to get full credit, your class must contain the following: • . A constructor that takes two Single Tables as Parameters 。 You should store these paramters as private class fields An override of getNumSeats - A combined table can seat a number of customers that is two fewer than the total number of seats in its two SingleTableObjects (to account for seats lost when the tables are pushed together). • An override of getViewQuality o If the two tables are the same height, the view quality is the average of the view quality of the two single table. o If the two tables are not the same height, the view quality is 10 units less than the average view quality of the two single tables. Part B) Write the getAverage View method from the Retaurant class. } /** Sets the quality of the view from this table */ public void setViewQuality (double quality) { } /** implementation not shown */ //there may be other constructors, fields, methods not shown /**Restaurant represents all the tables at a restaurant*/ public class Restaurant { public ArrayList<SingleTable> tableList; //there may be other constructors, fields, methods not shown /** Calculates and returns the average view quality of all of the * tables in the tableList field */ public double getAverageView() { /** implementation not shown */ }
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education