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