Project Detail

Simple Java Simulator  

Simple Java Simulator is project number 420777
posted at Freelancer.com. Click here to post your own project.

 

| More Free Trial For New Buyers
 

Status:

Selected Providers: is00hcw

Budget: $30-250

Created: 04/18/2009 at 21:38 EDT

Bid Count: 1

Average Bid:
N/A

04/20/2009 at 21:38 EDT

Project Creator: talend
Employer Rating: 10/1010/1010/1010/1010/1010/1010/1010/1010/1010/10 (5 reviews)

Bid On This Project
 

Description

Task is to write a simulator that will keep track of photos remaining on the screen by using Java Collection Framework (JCF). No graphical user interface (GUI) is allowed. At the end of the simulation, your program is to display the photos remaining on the screen in the order from left to right. Photos in each simulation will be identified by a unique name (a string without spaces) and its width. There are three types of events in the simulation:

* Arrive: A new photo arrives from the left side of the screen and pushing other photos to the right as needed. No photo moves to the right unless it is pushed by an adjacent photo on its left. Any photo that is not entirely on the screen will disappear. No single photo will ever be wider than the given screen.

* Pick Up: A photo identified by a unique file name is to be picked up. If the photo is on the screen, it will disappear from the screen and leave a hole on the screen; otherwise, the pickup operation is ignored.

* End: End the simulation for this case and print the remaining photos on the screen.
Input File

The input file will contain data for one or more simulations. The end of the input is signaled by a line containing only a single integer -1. Each simulation will begin with the integer width of the screen, s, followed by a series of Arrive, Pick Up and End events. An Arrive event is a single line beginning with an upper case A followed by the unique photo name and an integer denoting the width of the photo, w. A Pick Up event is a single line beginning with an upper case P followed by the photo name. Finally, the End event is a line containing only a single upper case E. All items in a line are separated by a single space.

Messages Posted:0 View project clarification board Post message on project clarification board

Bid On This Project
 

If you are the project creator or one of the bidders Log In for more options

Bids are hidden by the project creator. Log in as the project creator or as one of the bidders to view bids. You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


    Bid on this Project