CSE 2010: Asgn #12, Airline Database

Due: Wednesday, 1 Jul 2009 (midnight)

The Task

Create and effeciently maintain a database of flights. Answer querys of the form: which flights leave around a certain time between two airports. Use two indices (java.util.Map); one for flight numbers and one for city pairs. Use a java.util.SortedSet to return ranges.

Because Java time/date classes are so bad, we express time in minutes past midnight. For simplicity we think of the datebase as representing just one particular day.

Input/Output

Each line of the input consists of space-separated words of the following format:
+ AA122 MCO KCI $200.05   760
+ AA123 MCO KCI $200.25   820
+ AA124 MCO KCI $200.34   880
+ AA125 MCO KCI $200.45   940
+ AA126 MCO KCI $200.76  1000
+ AA127 MCO KCI $200.98  1060
? MCO KCI 850
- AA124
? MCO KCI 850
The output should be:
MCO KCI:  [(AA123 $200.25 820), (AA124 $200.34 880),  (AA125 $200.45 940)]
MCO KCI:  [(AA123 $200.25 820), (AA125 $200.45 940)]
Return all flights leaving less than 60 minutes before the given time and less than 120 minutes after the given time.

Read the input from the standard input until EOF (there is no sentenial value).

Helpful Stuff

Turning it in

Turn in the Java source code for the program using the submission server. The file name should be Flight.java and the project is asgn12. 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.

File 1
Control code:
Course=cse2010
Project=asgn12
(If you turn-in multiple files, use the general submissions page.)


Ryan Stansifer <ryan@cs.fit.edu>
Last modified: Wed Jul 1 17:44:38 EDT 2009