Aircraft

This represents the set of functions available to the system administrator. In this class, the user may:

  1. Add an aircraft
  2. Delete an aircraft
  3. Modify an aircraft

These are all functions which can access a database containing information on each aircraft type.

To get to this menu, the user must first login, and select 'aircraft' from the system administrator option menu.

The user will be prompted to select one of these three options, or to cancel the request and return to the previous menu.

Function Walkthrough

Here is a description of the three functions. It will include a description of the different inputs one can enter into the system, and the resulting outputs the user can expect.

Also, a detailed description of the various error messages that are possible.

Finally, an explanation of how the design works, and on which the actual coding will take place.

  1. Add an aircraft

    When a new aircraft model is obtained by the airline, the database must be updated, and the new records input.

    Once this option is selected, the sub-program will be called which contains a 'form' for the user to fill out.

    Adding a new aircraft

    This form will contain empty spaces for each of the attributes associated with an aircraft. The user will have the ability to input information into these fields.

    The attributes include the name of the aircraft type, the manufacturer, model, seating capacity, and some fields corresponding to the seating layout. These fields include the window, centre, and aisle columns, and the 1st, 2nd and 3rd-class rows.

    Each of these fields is more thoroughly explained in the data dictionary, and will include samples of valid and invalid input.

    Cancelling the request

    If the user wishes to cancel this request at any time, the user may do so by choosing the 'Cancel' button. This will return the user to the previous menu.

    Input complete

    When the user is complete, and feels satisfied that the information is correct, the user may select the 'Ok' button.

    Checking for invalid input

    Then, the computer will check each field, and ensure that each one has a valid input. Examples of valid and invalid input appear below.

    If an error is found, a box will appear, identifying the incorrect input. The user will be asked whether the user wishes to return to the previous menu, and change the input, or to cancel the request.

    Final confirmation

    If no errors are found, the user will be asked to confirm that the information is correct. A window will appear, and the user may select the 'Ok' button or the 'Cancel' button.

    If the 'Cancel' button is selected, the user will return to the main menu, and the new aircraft will not be added to the database.

    If the 'Ok' button is selected, the user will return to the main menu, and the new aircraft will be added to the database.

  2. Delete an aircraft

    If ever an aircraft is sold, destroyed, or for some reason is no longer available for the airline, the aircraft can be deleted from the database.

    Selecting an aircraft from the list

    Once this option is chosen from the main-menu, a list of all aircraft will appear on the screen.

    The list will be sorted in alphabetical order, and will contain all the fields in the database, including plane name, manufacturer, model, seating capacity, and seating layout information.

    Cancelling the request

    The user may cancel this request at any time by selecting the 'Cancel' button. This will return the user to the main screen.

    Selecting an aircraft

    The user may select one of the aircraft, and then select the 'Ok' button.

    Confirming the selection

    The user will then be prompted to confirm the selection. If the user responds by pressing the 'Cancel' button, the aircraft will remain in the database, and the user will be returned to the main menu.

    If the user responds by selecting the 'Ok' button, the aircraft will be deleted from the database, and the user will return to the main menu.

  3. Modify an aircraft

    Sometimes the information pertaining to an aircraft will be changed. The user may select this option from the main menu to initiate a sub-program where these changes can be made.

    Selecting an aircraft

    When this option is chosen, a list of all aircraft in the database will appear on the screen. It will be sorted alphabetically by name, and will include the manufacturer, model, seating capacity, and seating layout information.

    The user may now select one of the aircraft to modify. The user may then select the 'Ok' button to modify that aircraft.

    At any time, the user may select the 'Cancel' button, which will return the user to the previous menu.

    Modifying an aircraft

    Once an aircraft has been chosen, and the 'Ok' button has been selected, a chart will appear containing all the aircraft's current information.

    The information will include the aircraft's name, manufacturer, model, seating capacity, and seating layout information.

    The user may change any of the information in any field.

    As always, the user may at any time select the 'Cancel' button, and return to the main menu.

    Checking for invalid input

    Once satisfied with the modifications, the user may select the 'Ok' button.

    Then, the computer will check each field, and ensure that each one has a valid input. Examples of valid and invalid input appear below.

    If an error is found, a box will appear, identifying the incorrect input. The user will be asked whether the user wishes to return to the previous menu, and change the input, or to cancel the request.

    Final confirmation

    If no errors are found, the user will be asked to confirm that the information is correct. A window will appear, and the user may select the 'Ok' button or the 'Cancel' button.

    If the 'Cancel' button is selected, the user will return to the main menu, and no changes will occur to the database.

    If the 'Ok' button is selected, the user will return to the main menu, and the modifications will be made to the database.

Attributes of plane:

Plane Name

Due to customer's needs and requests, the planes will be identified with a name. It will consist of a string of characters and numbers of finite length.

Invalid and valid inputs

No two planes may share the same name.
All planes must have a name.

Manufacturer

The manufacturer of the plane will also be stored in the database. It is a string of characters and numbers of finite length.

Invalid and valid inputs

All aircraft must have a manufacturer

Window Columns

The letters corresponding to the columns of seats that are next to windows will be stored in the database. It is stored as a pair of alphabet letters.

Invalid and valid inputs

There must be exactly 2 window columns

Aisle Columns

The letters corresponding to the columns of seats that are aisle seats will be stored in the database. It is stored as alphabetic letters.

Invalid and valid inputs

There must be an even number of aisle columns
There must be at least 2 aisle columns

Centre Columns

The letters corresponding to the columns of seats that are neither aisle nor window will be stored in the database. It is stored as alphabet letters.

Invalid and valid inputs

The letters can't be the same as those in window or aisle

1st-class Rows

The row numbers of 1st-class seats will be stored in the database. It is stored as 2 whole, positive numbers separated by a dash, to indicate the block of rows that are designated as 1st-class.

Invalid and valid inputs

The numbers may not overlap the row numbers for 2nd and 3rd class
The 2nd number must be equal to or larger than the 1st.

2nd-class and 3rd-class Rows

These are identical to how 1st-class rows are managed.

Psuedo Code

Open database

If Plane X selected
	Create variable of type aircraft
	Copy attributes of Plane X to new aircraft
	Enable Add button
	Enable Modify button
	Enable Delete button
	Disable New button

If New selected
	Create variable of type aircraft
	Assign 'blank' to all attributes of new aircraft
	Enable Add button
	Disable New button

Call Display function with new aircraft

SELECT LOOP (explained in more detail elsewhere)
	If User selects a field
		Field = user input
UNTIL a button is selected

If 'Cancel' is selected
	Abort/Exit

If 'Delete' is selected
	Call confirmation function
	If confirm is YES
		remove plane from database
	If confirm is NO
		return to SELECT LOOP

If 'Add' or 'Modify' is selected
	Check 'type' field
		If blank
			Report error
			return to SELECT LOOP
	Check 'manufacturer' field
		If blank
			Report error
			return to SELECT LOOP
	Check 'window columns' field
		If blank
			Report error
			return to SELECT LOOP
		If LESS THAN 2 letters
			Report error
			return to SELECT LOOP
		If MORE THAN 2 letters
			Report error
			return to SELECT LOOP
		If NON-LETTER characters
			Report error
			return to SELECT LOOP
	Check 'aisle columns' field
		If blank
			Report error
			return to SELECT LOOP
		If ODD NUMBER of letters
			Report error
			return to SELECT LOOP
		If NON-LETTER characters
			Report error
			return to SELECT LOOP
	Check 'centre columns' field
		If substring EQUAL to substring of aisle columns
			Report error
			return to SELECT LOOP
		If substring EQUAL to substring of window columns
			Report error
			return to SELECT LOOP
		If NON-LETTER characters
			Report error
			return to SELECT LOOP
	Check '1st-class rows' field
		If 2nd number LESS THAN the 1st number
			Report error
			return to SELECT LOOP
		Compare it to other 2 classes:
		If 1st number < 1st number
			If 2nd number >= 1st number
				Report error
				return to SELECT LOOP
		If 1st number > 1st number
			If 1st number <= 2nd number
				Report error
				return to SELECT LOOP
			If 2nd number <= 2nd number	
				Report error
				return to SELECT LOOP
		If 1st number = 1st number
			Report error 
			return to SELECT LOOP
	Check '2nd-class rows' field
		*Same way as above*

If 'Modify' was chosen
	Update database

If 'Add' was chosen
	Check 'type' field
		If EQUAL to same field on another plane
			Report error
			return to SELECT LOOP
	Add item to database

Close database
Return to calling function

Aircraft Tests