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
contribution.
• The deadline for this work is: Monday October 20th before 4:30pm.
Description
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).
Resources:
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
the controller.
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
650 meters.
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
cruise.

Recommended Answers

All 8 Replies

No one is going to do this whole assignment for you. Post what you have done and what you need help with.

http://www.catb.org/~esr/faqs/smart-questions.html#urgent

> i have an assignment which i have to submit by tmw,
Awww - what a shame - tomorrow you say.

> The deadline for this work is: Monday October 20th before 4:30pm.
Now correct me if I'm wrong, but isn't it already past this time at the "university of wollongong in Dubai,"?

http://www.catb.org/~esr/faqs/smart-questions.html#homework

No doubt in your unbridled glee at finding a Java forum, you missed this on your way in.
http://www.daniweb.com/forums/announcement9-2.html

i didn't ask anyone to do the whole thing .. wat i wanted is if anyone had sth similar to wat i need he/she cld share with me so i cld have an idea abt it ... cuz i already started working on it and i got stuck in some parst

mr. Salem
just for ur info .. yeah it is right that i have to submit it by 2day but the doctor extended the subbmission for tmw :) thank u for being polite .. i guess i made a mistake by joining this forum !

i didn't ask anyone to do the whole thing .. wat i wanted is if anyone had sth similar to wat i need he/she cld share with me so i cld have an idea abt it ... cuz i already started working on it and i got stuck in some parst

mr. Salem
just for ur info .. yeah it is right that i have to submit it by 2day but the doctor extended the subbmission for tmw :) thank u for being polite .. i guess i made a mistake by joining this forum !

Lighten up daddio! O_O

What Salem is saying is that you should literally show us your script! Show us what you've written so we can help you.

Geeze, it's not like we're going to steal your assignment X_X

-Alex

i didn't ask anyone to do the whole thing ..

actually, you kinda did. you just posted your entire assignment without one single line of code you've tried.

you have to understand, that to us, this is not "urgent!!!". we're not a factory that creates java code, we're more like a think tank to help you find the errors in your code and maybe to find a more efficiënt way to code it. you have no code for us to review, or at least you didn't post it, so what do you expect us to do? in order to get it working, we would have to write the entire application ourselves, and believe you me.. we won't do that

commented: Nicely put. +23

just to show u guyz that i'v been workin on it :) and "am not posting this for help"

public class controller
{
	static int max =10;
	private int num_sub;
	private int id[];
	private int alt[];


	
	public controller ()
	{
		 num_sub=0;
		 id = new int[10];
		 alt = new int[10];
		 
		 
	}

	public int subscriber()
	{
		
		if(num_sub<max)
		{
			id[num_sub]=num_sub;
			alt[num_sub]=0;
			num_sub++;
			return(num_sub-1);
		}
		return -1;
}
	
	public boolean getauthorization(int id,int altitude)	
{
		for(int i=0;i<num_sub;i++)
		{
			if(alt[i]==altitude)
				return false;
		}
		alt[id]=altitude;
		return true;
				
		}
	
	public void unsubscriber(int plane_id)
	{
		if (num_sub>0)
		{
			for(int k=0;k<num_sub;k++)
			{
				if(id[k]==plane_id)
				{
					id[k]=id[num_sub-1];
					alt[k]=alt[num_sub-1];
					num_sub--;
				}
			}
		}
	}
	
	
}

what does (better yet, doesn't) it do? do you get any exceptions? which ones and on what line of code?

just to show u guyz that i'v been workin on it :) and "am not posting this for help"

That post is desperate plead for help, because provided code is just some sort of jumble. It has no firm ground as you been lying on your back while other figured they solution. I will not provide any support till you provide something proper and ask direct questions on existing problem and not asking for full scale solution as you do now indirectly...

PS: NOT URGENT TO US.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.