Reservation Problem there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reserve only 5 seat at a time. If person reserving seat , the care is taken that he may get all in row. if seats are not available in row then the arrangement is so that person group get nearby seats.
the following class is given
public class seat
{
char name;
int seat;
boolean isSeatempty
}
Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name.
This is a problem i found in an interview paper. how do i go about it?? Should i check for all 67 seats objects in a loop?? esp. with the case of last row and the problem of giving seats nearby if full row is not available. Thanks in advance for help.