cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Lift Control system
Lift Control system
Apr 28, 2014 at 6:04am UTC
Hadi951
(1)
Hi, i need to program and simulate a 2 floor lift control system. can anyone tell me how to do that ? i need to design its program only.
Apr 28, 2014 at 9:38am UTC
Codermik
(835)
Make an numeric array of say size 10, each index of the array would be a floor. Where the actual lift is would be indicated by a value 1 and where it is not would be a 0
so...
array[0] = ground floor
array[1] = level 1
array[2] = level 2
... and so on
so if person in lift hits floor 3, you would move up the index placing a 1, clearing the previous position back to 0 until you reach floor 3.
Topic archived. No new replies allowed.