Skip to content

Requesting solution for Reservation Program

chandra shekar

Asked Sep 29, 2009, 10:47 PM EDT1 answer
Share
LinkedInX
Hi experts,

I have two problems for which i need a solution in c#.net.Please any body know the solution please send me your answers. Problems are


1)Reservation.

 
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 reseve only 5 seat at a time.
If person reserving seat , the care is atken 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
}

1.Draw require class digram and object diagram.
2.Write function seatallot(int noofperson)
to allocate seat with seat nuber printed for the each name.

Program 2.
 
Stringreplace

The forum is going on and administartor find that some people use abusing or

bad lnaguage in discussion.so he decided that when he uses such language it
was replacedc with beap.

question:

1. draw class digram,and use appropriate data structure.
2. write function replacestring()


Thanks in advance

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Java
     public List seatallot(int noofperson)
    {
       List<seat> _seatList = new List<seat>(noofperson);
       seat s1;
    
      for(int i=0; i < noofperson; i++)
      {
        s1.name = "personname";
       s1.seat = seatnum;//pass it by parameter or some other means
        s1.isSeatempty = true;//it is booked
      }
    
    return _seatList;
    
    }

    0