Seem to be getting a can't find symbol error. Not quite sure how to fix it. Yes this is a homework problem, this is what I have done so far.

public class Flight
{
public String location = "Gate";
public String number;
public Airport origination;
public Airport destination;
public Airport currentAirport;

public Flight(String nbr, Airport orig, Airport dest, String stat)
{

number = nbr;
origination = orig;
destination = dest;
status = stat;
currentAirport = orig;
}


public void taxiOut()
{
	currentAirport = origination;
	if (origination.currentRunway().getStatus().equals("Empty"))
	{
	setStatus(" taxiing");
	setLocation("Runway");
	}
	else
	{
	setStatus("Waiting to taxi");
	setLocation("Gate");
	}

	}

public void taxiIn()
{
	setStatus( " taxiing");
	setLocation("Runway");
	currentAirport = dest;
}

public void takeOff()
{
	setStatus(" taking off");
	setLocation("Lifting off ");
}

public void land()
{
	setStatus(" Landing ");
	setLocation("Landing ");
	currentAirport = destination;
}



public void showLocation()
{
	System.out.println("Flight " + getNumber() + " at " + getLocation() + " at airport " + currentAirport.getAirportName());
}




public void setLocation(String loc)
{
	location = loc;
}

public void setStatus(String stat)
{
	status = stat;
}

public void setNumber(String loc)
{
	number = nbr;
}

public String getLocation()
{
	return location;
}

public String getStatus()
{
	return status;
}

public String getNumber()
{
	return number;
}

public String getOrigination()
{
	return origination.getAirportName();
}

public String getDestination()
{
	return destination.getAirportName();
}

}

EDIT: Sorry should have told the errors.
1.)symbol : variable status
location: class Flight
status = stat;

2.)symbol : variable dest
location: class Flight
currentAirport = dest;

3.)symbol : variable nbr
location: class Flight
number = nbr;

4.)symbol : variable status
location: class Flight
return status;

line 12
line 14
line 15
line 88

Recommended Answers

All 2 Replies

The error message tells you which symbol on which line. Wanna share that with us, or should we just guess?

OK, line 15 "status" ?

status: you don't have a variable named status
currentAirport = dest; you don't have a variable dest in that scope
number = nbr; I assume you mean: number = loc;
and the last one, exactly the same reason as the first problem

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.