Java
OOP GUIDE / WORK
SINGLETABLE CLASS
Topics
SOLUTIONS
int numSeats;
double viewQuality;
int height;
public class SingleTable
{
private int seats;
private int height;
private double viewQuality;
public SingleTable(int s, int h, double vq)
seats = s;
height = h;
viewQuality = vq;
}
public int getNumSeats()
return seats;
public int getHeight()
return height;
public double getViewQuality()
return viewQuality;
public void setViewQuality(int qual)
viewQuality = qual; //might want to have constraints here
public class TableTester
public static void main(String[] args)
SingleTable t1 = new SingleTable(4, 74, 60.0);
SingleTable t2 = new SingleTable(8, 74, 70.0);
SingleTable t3 = new SingleTable(12, 76, 75.0);