Find Jobs
Hire Freelancers

Elevator Simulator in Java

$30-5000 USD

In Progress
Posted about 22 years ago

$30-5000 USD

Paid on delivery
You are to simulate the movements of an elevator in a building, which works according to the following rules: The building has only three stories. The elevator stays 3 seconds for customers to get in or get out. If some customers want to get in and some want to get out, the elevator stays 6 seconds. It takes the elevator 2 seconds to go one story upwards or downwards. When there is no request for service, the elevator stays where it is. Namely, it is idle. When the elevator is idle, and a request comes from upwards or downwards, it moves upwards or downwards. If a request comes from the story where it stays, the elevator opens its door to serve these customers. When the elevator goes upwards or downwards, it keeps its direction until there is no request from upwards or downwards. However, it breaks off to let customers get out or pick up customers if necessary. If the elevator is to go upwards or downwards, it does not accept customers intending to go upwards or downwards. When the elevator can act more than one way according to aforementioned rules, it chooses the action with the highest priority. The priorities for actions, from the highest to the lowest, are: let customers get out let customers get in go upstairs go downstairs Initially (at time 0), the elevator is in the 1th story, and it is idle. Given the requests, you are to output how the elevator moves in a designated interval. Suppose that each request comes at an integer second. Input Each of the lines in the input file consists of three numbers, N1, N2, and N3, representing a request coming from N2th story to N3th story at time N1. Output You have to output what the elevator acts at each second in the designated interval. Sample Input 1 2 1 3 2 4 1 3 5 2 1 6 3 1 9 2 1 10 Output for the Sample Input 0: idle at story 1 1: let customer1 get in at story 1 4: going up to 2 4: customer2 waiting at story 3 5: customer3 waiting at story 1 6: let customer1 get out at story 2 6: customer4 waiting at story 2 9: going up to 3 9: customer5 waiting at story 3 10: customer6 waiting at story 2 11: let customer2 and customer5 get in 14: going down to 2 16: let customer2 get out 19: let customer4 and customer6 get in 22: going down to 1 24: let customer4, customer5, customer6 get out 27: let customer3 get in 30: going up to 3 34: let customer3 get out 37: idle at story 3 ## Deliverables Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. ## Platform Windows
Project ID: 2843124

About the project

27 proposals
Remote project
Active 22 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$17 USD in 14 days
4.9 (139 reviews)
5.6
5.6
27 freelancers are bidding on average $63 USD for this job
User Avatar
See private message.
$29.75 USD in 14 days
5.0 (137 reviews)
7.0
7.0
User Avatar
See private message.
$25.50 USD in 14 days
4.8 (37 reviews)
5.3
5.3
User Avatar
See private message.
$17 USD in 14 days
5.0 (60 reviews)
5.0
5.0
User Avatar
See private message.
$29.75 USD in 14 days
5.0 (43 reviews)
4.8
4.8
User Avatar
See private message.
$51 USD in 14 days
4.7 (41 reviews)
4.7
4.7
User Avatar
See private message.
$46.75 USD in 14 days
4.5 (42 reviews)
4.6
4.6
User Avatar
See private message.
$25.50 USD in 14 days
4.6 (60 reviews)
4.5
4.5
User Avatar
See private message.
$42.50 USD in 14 days
5.0 (12 reviews)
4.3
4.3
User Avatar
See private message.
$17 USD in 14 days
5.0 (32 reviews)
4.2
4.2
User Avatar
See private message.
$51 USD in 14 days
5.0 (13 reviews)
4.0
4.0
User Avatar
See private message.
$42.50 USD in 14 days
5.0 (8 reviews)
3.6
3.6
User Avatar
See private message.
$21.25 USD in 14 days
4.8 (9 reviews)
3.3
3.3
User Avatar
See private message.
$29.75 USD in 14 days
5.0 (18 reviews)
2.9
2.9
User Avatar
See private message.
$11.05 USD in 14 days
5.0 (3 reviews)
1.8
1.8
User Avatar
See private message.
$25.50 USD in 14 days
5.0 (5 reviews)
1.2
1.2
User Avatar
See private message.
$21.25 USD in 14 days
5.0 (5 reviews)
1.1
1.1
User Avatar
See private message.
$21.25 USD in 14 days
5.0 (1 review)
0.7
0.7
User Avatar
See private message.
$17 USD in 14 days
5.0 (2 reviews)
0.6
0.6
User Avatar
See private message.
$12.75 USD in 14 days
4.0 (2 reviews)
0.5
0.5
User Avatar
See private message.
$17 USD in 14 days
5.0 (1 review)
0.0
0.0

About the client

Flag of UNITED STATES
United States
0.0
0
Member since Mar 21, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.