public class CombinedTable{

	// each CombinedTable is formed by combining two tables
	private SingleTable s1;
	private SingleTable s2;
	
	public CombinedTable(SingleTable st1, SingleTable st2)
	{
		s1= st1;
		s2= st2;
	}

	public boolean canSeat(int seat)
	{
		int seat1= s1.getNumSeats();
		int seat2 = s2.getNumSeats();
		
		int newSeat = seat1 + seat2 -2;
		if ( seat > newSeat) return false;
		else return true;
	}
	
	public double getDesirability()
	{
		int h1= s1.getHeight();
		int h2 = s2.getHeight();
		double d=0.0;
		
		if (h1 == h2)
			d = (s1.getViewQuality() + s2.getViewQuality()) /2;
		else d = ((s1.getViewQuality() + s2.getViewQuality()) /2 ) - 10;
		
		return d;
	}

}


