Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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.

Answer Posted / Mohan Singh

[
{"name": "Class Diagram", "description": "UML Class Diagram showing the relationships between Seat and Person classes, where Seat has a many-to-one relationship with Person, and contains attributes: name (character), seat (integer) and isSeatEmpty (boolean)."},
{"name": "Object Diagram", "description": "Object diagram representing an example state of the system. It may contain instances of the Seat class, each assigned to a specific person with a given seat number, and marked as either empty or occupied."},
{"name": "Function seatallot(int noofperson)", "description": "Java method that accepts the number of persons as input and returns void. It checks the availability of seats in rows from left to right, starting with the first row. If a group of 5 seats is available, it allocates them to the next 5 people in the list. If not, it finds the nearest available 5-seat block or 2-seat block and allocates those seats accordingly. The function prints the seat number for each person along with their name as part of the allocation process.".}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the locale class?

1018


What do you understand by casting in java language? What are the types of casting?

921


What if I write static public void instead of public static void?

926


How does java handle integer overflows and underflows?

1102


What is the resourcebundle class?

997


what is reflection api? How are they implemented?

1095


What is the java api?

981


What is the first argument of the string array in main method?

1023


Are jvm’s platform independent?

966


Can we extract main method from another class?

1019