hello everyone, am new member in this forum, i found it very interesting, specially cuz am an IT student in university of wollongong in Dubai, i have an assignment which i have to submit by tmw, so if any one cld help i'd be thankful, i tried solving it but came up with no solution, so if anybody have seen such a programe or worked on sth simielar ,, let me know as soon as possible .. thanks alot .. and here is the assig.
CSCI 231 (autumn 2008)
Assignment 1 (Version 1.0)
• The work can be done individually or by a team of no more than two students; if the
work is done by a team, each student must provide a paragraph specifying his or her
• The deadline for this work is: Monday October 20th before 4:30pm.
We want to build a simulator for an automatic pilot system and an air controller. The
automatic pilot system is software, controlled (activated and deactivated) by a pilot, that
controls the navigation of an airplane into different directions. In this homework, you will
implement some (not all) of the functionalities of the Automatic Pilot System and basic
functionalities of an air controller.
An automatic pilot system has the following main functionalities to control the navigation:
• move an airplane up to a specified altitude
• move an airplane down to a specified altitude
• maintain an airplane in a cruise for a specified duration of time
• Interact with an air controller for safety reasons
An air controller has three main functionalities:
• Receive subscription from airplane when they enter its airspace.
• Authorize an airplane to use or not a specified altitude
• Unsubscribe airplanes when they leave its airspace
These functionalities are grouped into classes called respectively airplane and controller,
which you will need to complete. Both the controller and the airplane(s) are controlled
through a main program (sample will be provided).
1. The class Airplane contains at least the following main functions:
a. Two constructors need to be developed for this class:
i. The first constructor needs only to receive a reference to an object of
type controller. An object created with this constructor will be
commanded from the main program.
ii. The second constructor needs to receive a reference to an object of
type controller, a destination altitude and a trip duration (units of
times) to cruise before landing.
b. “moveUp (int L)”: // move the airplane up to altitude specified by L
c. “moveDown (int L)”: // move the airplane down to altitude specified by L
d. “cruise(int t)”: // cruise for t units of time
e. “land()”: this method, initiates a landing process by moving down one level at
a time until the altitude is zero.
f. “void log (String record)”: All the previous method (creation of objects, moving
up and down and cruising and landing) must each keep track of the history of
their execution. For this purpose, the class needs a private method which
writes a log into common log file shared by all airplanes. This method is
called by the other method to save a record in the log file. Each record in the
log file specifies (1) the id of the airplane, (2) date and time, (3) the actual
altitude, (4) the target level towards the destination, and (5) the response
from the controller. Each record is written on a separate line. The log file
name must be FlighHistory.txt”.
2. The class controller contains at least the following main functions:
a. The constructor of the controller.
b. “int subscribe ()”: this method subscribes an airplane and return a unique ID
to be used by the airplane for further communications with the controller.
c. “bool getAuthorization (int id, int altitude)”: this method is called by an
airplane to get authorization to move to a specified altitude.
d. “unsubscribe (int planeID)”: this method is called by an active airplane (i.e.
with a valid ID) to unsubscribe when it does not need the service provided by
3. A main class that run the simulation; creates controller and many airplanes and
allows them to move around.
4. Description of operations:
a. Changing the altitude of a plane: The control of the movement of an airplane
is done using the notion of stage; a stage is equal to100 meters. When a
plane starts moving up or down, he moves one stage at a time until he
reaches the closest altitude to its objective.
i. Example 1
1. Actual altitude = 300 meters
2. Target altitude = 700
3. The plane will first go through the stages 400, 500, 600 and
finally 700 meters.
ii. Example 2
1. Actual altitude = 350 meters
2. Target altitude = 700
3. The plane will first go through the stages 450, 550 and finally
b. Cruise (flying at the same speed for a certain a mount of time):
i. Input: number of units of time.
ii. Behavior: During this phase, turbulences may happen and hence the
altitude of the airplane may change. To simulate the turbulences, we
use a random generator. Two random variables need to be computed
using the random generator, for each unit of time: change in the
altitude and its direction of change.
1. For the direction, we generate a random number between 0
and 1 (i.e. either 0 or 1) and for the amount of changes we
draw a number between zero and fifty (0...50).
2. The automatic pilot system checks with the controller to verify
if the current altitude is acceptable or not at the end of each
unit of time. If the altitude is not acceptable, the plane should
try to go back to the original altitude at the beginning of the