CSE 2010: Asgn #11, Argus
Due: Friday, 26 June 2009 (midnight)
The Task
Read from the standard input and
record a series of queries which are repeated at regular intervals.
Output the first k queries in order of execution.
This is accomplished easily using a priority queue.
You may use the class PriorityQueue from the Java API (you don't
have to implement your own priority queue class).
Input/Output
The input is divided into two parts.
The first part are the queries.
There will be at least one query and each query appears on a line of its own.
Each query has a unique query ID number (0<id<1,000,000)
and an interval (0<v<5,000).
This section is terminated by a line with the single character # on it.
Register 12345 200
Register 12346 300
#
5
The input ends with a single number k, 0<k<10,000.
The output for the previous input as follows (the comments are for your information
only and are not part of the output):
12345 # at time "200"
12346 # at time "300"
12345 # at time "400"
12345 # at time "600" (smallest id first)
12346 # at time "600"
Helpful Stuff
Turning it in
Turn in the Java source code for the program using the submission server.
The file name should be Argus.java and the project is asgn11.
Be sure your name is in comments at the beginning of your program
as required in the standard header for this class.
For your convenience, here is a submission form for this assignment.
(If you turn-in multiple files, use the general
submissions page.)
Ryan Stansifer <ryan@cs.fit.edu>
Last modified: Wed Jun 24 16:49:13 EDT 2009