Hello everybody,

I'd like to implement an application of rooms and doors as follows;
room has identification number and description, e.g. Art Hall.
room has one or more door(s) in one direction, e.g. door 1 allows you to move from room 1 to room 2 not the way around.

Each student has ID card, and he is allowed to enter specific room depend on a specific policy. When he is allowed, the system store that room (x) has list of students in this room.

I need to know how can I represent these classes, i.e. the data structure.

Thanks in advance

OO design 101:
Underline the most important nouns in the problem description. These are a useful starting pont for a list of main classes. Then collect the data and behaviours associated with each of those to give an external spec. for each class. Review, correct and improve till it looks right.
eg A door (important noun: implies a class) is associated with two rooms (data: implies instance variables) and allows a student to move (behaviour: imples a method) from one room to the other. A room has a list of students in it... etc etc

ps: Yes, I know this is over simplified, but you have to start somewhere.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.