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 / 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 |
What is type inference? Is type inference available in older versions like java 7 and before 7 or it is available only in java se 8?
What is proxy object in java?
Who is at risk in java? : java security
What is rxjava2?
What does @override mean in java?
What is cdi in java?
is hibernate a technology or framework?
What is exe file in java?
What is an entity in java?
What's the difference between code-based security and role-based security? Which one is better? : java security
Is lambda cheaper than ec2?
Are there tuples in java?