Oh yeah. Now your making me remember a program we had to write in school. It was an elevator program and it had to simulate a 5 story building.
Think about it. To evoke the elevator, you have to have random people pushing the call button. Some will want to go up, some will want to go down. If your on the top floor, you can only go down, if your on the bottom floor, you can only go up.
You'll need:
1. Call buttons. (up and down)
2. Doors (open and close)
3. Lights and bells
4. Floors (5)
5. Random people on each floor.
6. People getting on and off the elevator from various floors.
Sounds easy, and you only need a few functions and a couple of array's (one dynamic and the other static) along with an assortment of variables. It's a great test of logic and can be streamlined easily.
Flow would go:
Create person on random floor.
Person calls elevator
Elevator arrives at floor.
Bell dings, light goes on.
Person selects floor.
Elevator proceeds to designated floor.
Elevator stops at additional floor only picking up passengers traveling in the same direction as passengers already on elevator.
Passengers by passed go into holding queue (first come first serve) when the elevator reverses flow.
Results display from the command prompt. This is a text only program cout << "Down button pressed by user x on floor x";
cout << "Elevator arrives at floor x"
cout << "Bell rings and light displays floor x"
cout << "Door opens "
cout << "User enters elevator and presses floor x"
cout << "Door closes and elevator travels to floor x"
cout << "Elevator stops at floor x to pick up passenger x"
cout << "Bell rings and light displays floor x"
You get the idea.
Sounds easy enough huh?