
/**
 * Write a description of class LunarLander here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LunarLander {
    double altitude;
    double velocity;
    double fuel;
    final double acceleration = 1.64;
    final double fuelFactor = 1.0;
    final double fuelLimit = 2.0;
        
    /**
     * Constructor for objects of class LunarLander
     */
    LunarLander(double altitude, double velocity, double fuel) {
        this.altitude = altitude;
        this.velocity = velocity;
        this.fuel = fuel;
    }
    
    void burn(double amount) {
        if (amount > fuel) amount = fuel;
        if (amount > fuelLimit) amount = fuelLimit;
        velocity = velocity + acceleration - amount * fuelFactor;
        fuel = fuel - amount;
        altitude = altitude - velocity;
    }
    
    double getFuelRemaining() {
        return fuel;
    }
    
    double getAltitude() {
        return altitude;
    }
    double getVelocity() {
        return velocity;
    }    
}
