0

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

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by JamesCherrill
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.