Java Fifth time job

Source: Internet
Author: User

Final Project

We encourage simulate a lift system with the stops (floors). We assume every customer takes 1 second to enter the lift and 1 second to leave. The lift ' s occupation space is a people with no weight limit. It takes seconds for the lift to travel between, nearby floors without discrimination for going up or going Down. An input file is given to which simulates the coming customer randomly. Here is a DEMO inputs:

Customer ID

Coming time

Age

Source floor

Destination floor

Leaving time

123

+

2

9

 

2

"

+

5

 

4

382

+

1

 

The customer coming time isn't sorted, so you need to sort themfirst. Also one rule need to being noted is this for those customer whose ' age ' larger than, they'll get the highest privilege To enter and leave the lift without waiting in the queue. We encourage different data structures at different floors. The sorting algorithm is appointed to use during the free time. The output would be is a file similar to the input file with calculated/simulated leaving time filled in (to the last column).

Req:

@ Weeks later delivery operation (until 4.21)

@ using Java ' s encapsulation,inheritance and polymorphism technique

@ according with "Open and close" principle

@ maybe using ArrayList, LinkedList and Stack etc. class and sort method,study them yourself

Java Fifth time job

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.