Click here to Skip to main content
15,893,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please guide me about seat object attributes in bus terminal that terminal consists of this objects:
bus object - seat object - travel object - ticket object - passenger object - sale object - reservation object and so
C#
public class bus
{
public bus()
{
}
//attributes
private string name;
private string id;
private int capacity;
private seat _seat;
}

public class seat
{
public seat()
{
}
//Attributes
private int seat_id;
private bool seat_status;
private bool seat_place;// it means that seat places besides the window or not
}

I want to know:
Is seat object consist of passenger object?
and another question:
Is it necessary to have all ticket and sale and reservation objects or any one is necessary?
Posted
Updated 29-Aug-10 21:59pm
v4
Comments
Sandeep Mewara 29-Aug-10 4:45am    
It's your project, how can we say what is necessary and what not?

"is the seat object consist of the passenger object???"
No, but it might need a Passenger object or [probably better] Reservation Object. seat_status probably isn't needed if you have one of these.

"Are necessary ticket and sale and reservation"
The answer depends upon what the system actually needs to do.For example, if you can buy a ticket without a reservation, you'll probably need both of these, but if the system always allocates a reservation, it might as well be on the ticket. "sale" is a bit more tricky as it could mean one of many things, but assuming it is like an "invoice" i.e. billing information, it does sound sensible.
 
Share this answer
 
I think you want to know

How many objects should be in system and
What are the relationship among them

see basically it is depends on project size/project level

for example your question is
Is seat object consist of passenger object?

if your system need to store passenger id and information of passenger
then yes

but if you want to store that the seat is occupied or not than you can manage it with simple bool type.

Is it necessary to have all ticket and sale and reservation objects or any one is necessary?

again if you want to store information which ticket/reservation is allocated to whom than you should have object of all that types


one more thing I have notice
In your Bus class seat object should collection of seat.
 
Share this answer
 
v2
All class structures are dependant upon the actual problem you are trying to break down. In this case you need to figure out for yourself whether the the reservation is given to a passenger, or is the reservation really part of a ticket.
 
Share this answer
 
my friends

i say that:
ticket object contains seat object and travel object and passenger object .

bus object contains seat object and driver object .

However,that the ticket object contains passenger object

is necessary seat object contains passenger object too??
 
Share this answer
 
Comments
Sandeep Mewara 29-Aug-10 10:40am    
Reason for my vote of 1
Not an answer. Use 'Add comment' feature to respond to an answer.
Christian Graus 30-Aug-10 4:05am    
No, it's not. We said that. You have to choose how it's laid out - it's your homework.
nobody is not to guide me more?
 
Share this answer
 
Comments
Christian Graus 30-Aug-10 4:05am    
I suspect that we feel that you've been given enough help to try to do your own homework. You should also not push 'answer' to comment or ask questions.
DaveAuld 30-Aug-10 5:33am    
Reason for my vote of 1
This is a comment not an answer?
i need to guide your dears

bus terminal objects

reservation object or sale object or both plz guide me dears.
 
Share this answer
 
Comments
DaveAuld 30-Aug-10 5:33am    
Reason for my vote of 1
This is not an answer!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900