The Student Room Group
What is the actual question?
Reply 2
Yeah, copy the question and we might be able to help you.
Reply 3
The question is: There are 6 floors, each floor exactly 5 metres apart. Develop and algorithm to go to which floor you want, but the lift will be on previous floor it went to for next user. (eg. if first user on ground floor wants to go to 3rd floor, lift will go to 3rd floor. and then if another person on the 2nd floor wants to go to 4th floor, lift would come down to 2nd floor then up to 4th floor etc)

basically, if it makes sense.
Del - duplicate
Think of an algorithm as being a recipe to produce a certain dish. Break the problem down into manageable chunks (eg how do i move from one floor to the next) and work out the recipe steps to complete each chunk.

An example of the chunks \ steps you might use is:

Find which floor lift is on sequence

Call lift to appropriate floor sequence

Open doors, person boards, close door sequence

Move to required floor sequence



Then you would take each chunk and work out the individual steps required to complete that chunk. You just need to make sure that each step is in a logical order.

Remember, algorithms can be written in structured English; pseudocode is not necessary.
Reply 6
is this for a programming or computer science course?

Im just wondering if I should start talking about arrays in pseudo code and so on..
Reply 7
I do AQA Computing, but it's supposed to be in structured english, so pseudocode is not necessary. =/
Reply 8
You're telling the lift what to do when someone presses a button... so, if someone pushes a button on a floor, you tell the lift to go up to that floor. How does it know how to go to that floor? Well, you'd take the current floor, and the floor it needs to go to, multiply them by 5 and find the difference in distance between the two, then go up or down that many. You also need to work out what to do when someone pushes a button inside the lift: that's essentially the same thing.

With the open/close door sequence, you have a bit of choice... the easiest one for you to do in an algorithm is probably to have the doors close a few seconds after a button is pressed inside the lift, and open when the destination is reached (and remain open on that floor, but not any others). Then you could add a step that checks if there are any passengers inside the doorway, and if there are, open the doors and close them again a few seconds later.

Then I suppose there's the emergency stop button, which sort of speaks for itself :p:

You basically need to write what I've said for each 'sequence' (lift call, button inside lift, open/close doors, emergency stop) in a sequence of steps.
Reply 9
nuodai
You're telling the lift what to do when someone presses a button... so, if someone pushes a button on a floor, you tell the lift to go up to that floor. How does it know how to go to that floor? Well, you'd take the current floor, and the floor it needs to go to, multiply them by 5 and find the difference in distance between the two, then go up or down that many. You also need to work out what to do when someone pushes a button inside the lift: that's essentially the same thing.

With the open/close door sequence, you have a bit of choice... the easiest one for you to do in an algorithm is probably to have the doors close a few seconds after a button is pressed inside the lift, and open when the destination is reached (and remain open on that floor, but not any others). Then you could add a step that checks if there are any passengers inside the doorway, and if there are, open the doors and close them again a few seconds later.

Then I suppose there's the emergency stop button, which sort of speaks for itself :p:

You basically need to write what I've said for each 'sequence' (lift call, button inside lift, open/close doors, emergency stop) in a sequence of steps.


Thanks for the help, that is really useful, I understand it better now.

Latest

Trending

Trending