Elevator Function confusion

My teacher assigned us a group project to make a a concept model of an elevator that we supposedly designed earlier. We understand the basis of the project, but we have no idea what to do with the functions. The project description and psuedocode are rather long, so I won't post them unless someone shows an interest in seeing it.
Please help. All of us are very confused and the teacher refuses to help because he assumes we absorbed the knowledge through ESP or something.

If your question is more indepth about what you need to do with functions for this project, you'll need to post a little more information about the project, and what your ideas about it are so far. That way people can help you figure out what the answer is.

Good luck!

Kermi3

If you're new to the boards, welcome and reading this will help you get started.
Information on code tags may be found here

Not to make you feel bad, but you seem to think we could determine what problems you're having through ESP or something. ;P
You need to specify what you're actually having a problem with. Are you talking about an elevator as in a box you get in and go up and down in or an elevator algorithm used to read a disk? What exactly do you need to do and what exactly are you unable to do?

Just fill in some of the details and you'll have lots of answers immediately.

Sorry about the lack of details. Here's what the teacher supplied us with. There's rather a lot for a forum, but oh well:

Elevator Simulation Project
You are an engineer designing an elevator system for a two-story building.
Before you begin construction, your client asks you to create a simulation of
the performance of your design. The client specifies that the elevator begins
the day at rest on the first floor. He says, "let's assume that every twenty
time periods a scheduler randomly decides to populate each floor in the
interval of 5 to 20 time periods into the future." At the scheduled time the
person mysteriously arrives on the specified floor and calls the elevator
(should there already be someone waiting on the floor, the arrival time of the
new person is delayed until the floor is empty). The elevator takes five time
periods to move between floors. It has a capacity of one person. During the
time in which it arrives on a floor, it first unloads, loads, and begins its
trip to the next floor. To review your design, the client requires a detailed
report of the status during each time period. This report must include the
elevator status: full/empty, destination (floor 1, floor 2, or resting) and
arrival time; floor status: person waiting/vacant, scheduled arrival time of
next person. The simulation is to run for 100 time periods.

Declare and initialize variables
Open file
Write log heading
While time is less that 101
Do what you need to do each time period
Every 20 time periods
Generate Person creation times (floor 1)
Generate Person creation times (floor 2)
If person creation time occurs
Load People on Floor
Do Elevator Stuff
if Elevator Arrived on floor
if full
Unload?
if person is waiting on this floor
Load?
Set Destination
Set Arrival Time
else if person waiting on other floor
Set Destination
Set Arrival Time
else
Increment Arrival Time [note: this is how a resting elevator
occurs]
Write Report Line
Increment clock
Close file.

He said we needed to make each verb into a function. We figure that's 12 functions: OpenFile, LogHeading, GeneratePeopleTimes1, GeneratePeopleTimes2, Load, Unload, SetDestination, SetArrivalTime, IncrementArrivalTime, IncrementTime, WriteLog, CloseFile. We're supposed to do code stubs for these functions, but we're not sure how to make these functions link up and work together.

Not at all, but it sadly is not enough effort from you. What exactly is your problem? What do you mean by "link up and work together"?

Functions call each other by name, so if you have

void func();

you can call it from another function using

func();

Oh, and some of those functions you identified already exist. OpenFile and CloseFile exist in the <iostream> library, as ofstream::ofstream and ofstream::~ofstream, or ofstream::open and ofstream::close.

Last edited by CornedBee; 12-16-2004 at 01:58 AM.

All the buzzt! CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law