Project 1 : Incoming Flights Display Simulation
Due : 9.30am, 17 July
Design and write a program to simulate the operation of the incoming
flights computer screen that is found at a typical small airport like
the Roanoke Regional Airport.
The information that needs to be displayed about each flight is:
- Airline - [string of maximum length 10] Name of the airline, eg. USAir
- Flight Number - [string of maximum length 6] eg. 4120
- Origin - [string of maximum length 20] Place where the flight originated from
eg. NewYork
- Date/Time - [integers: Hour, Minute, Day, Month, Year] Arrival time of the flight
- Status - [string of maximum length 15] Whether the flight is "OnTime" or "Delayed"
Basic Operation
Store the incoming flights in an array of structs. The display must show a
fixed number of flights in a simple table where each flight corresponds to one
line of the table (set this fixed number in a constant with a value of 5)
and present the user with an interactive interface to change the list.
The list of flights must be sorted in order of time so that the earliest expected
flight is at the top of the list. The interactive interface can take the form
of a list of options printed at the bottom of the flight list, followed by the user
inputting a character and the system then acting upon that input (continued
until the user explicitly chooses to quit).
There must be options available to do each of the following:
- Add a flight - If the user selects this option, the user must input all the
required values for a new flight, which must then be added to the list.
- Delay a flight - The user must be prompted for the Airline and Flight number
and then the status of the flight must be changed from "OnTime" to "Delayed".
- Remove a flight - Assuming that the flight has either arrived or been cancelled,
the user must be prompted for the Airline and Flight number, whereupon the
appropriate flight must be removed from the list.
- Load a batch job from disk - (as discussed below)
- Quit
Note that error-checking is optional and constitutes an easy way to
earn creativity points for this assignment.
Batch input
When you load a file from disk the contents are read in as a stream of words.
If the first word is "add", the rest of the line contains Airline, Flight, Origin,
Minute, Hour, Day, Month, Year. If the first word is "delay" or "remove" the rest
of the line contains Airline and Flight. Some typical lines from a batch file
are display below:
remove SAA 601
add PanAm 411 Paris 0 10 5 7 2000
delay TWA 6202
Here are a sample set of batch files that can be executed in sequence:
file1.txt file2.txt
file3.txt.
Assumptions
You may make the following assumptions:
- Each flight has a unique airline/flight number combination.
- Each string is a single word and does not contain any intervening spaces -
so "New York" would be stored/displayed as "NewYork".
- There will never be more than 100 flights, and the system begins with zero
flights listed. While the system displays only 5 flights, the rest must remain
hidden - there should be no option to scroll.
- All new flights are automatically set to be "OnTime".
Sample Screen Display
Flight Arrivals
Airline Flight From Time Date Status
------- ------ ---- ---- ---- ------
Delta 7248 Atlanta 08:10 07/04 OnTime
Mauritius 657 Mozambique 08:25 07/04 OnTime
Lufthansa 105 Frankfurt 20:12 07/04 OnTime
Virgin 212 Kingston 08:00 07/05 OnTime
PanAm 411 Paris 10:00 07/05 OnTime
Options: [A]dd Flight / [R]emove / [D]elay / [L]oad from disk / [Q]uit
Submission
- Submit a .zip file (created by WinZip or PKZip) containing all your
source files, header files, and workspace files. It must be possible for us to
recompile your project based on the files you submit - please test this before
submission. Do not submit .exe, .obj or any intermediate files
like precompiled headers. Your projects must be submitted through the
online submission system.
- Make a printout of your source code and some relevant screen dumps and
submit these in paper form.
- Make an appointment with the class TA to demonstrate your program during
his office hours. More information on this will be provided by Pete at a later
date.
Last updated : 7 July 2000 11.22am