public class Car {
  // instance fields
  private double myGas;
  private double myMPG;
  
  // constructor
  public Car(double gas, double mpg) {
    myGas = gas;
    myMPG = mpg;
  }
  
  // methods
  // accessor methods - they don't change the instance fields
  public double getGas() {
    return myGas;
  }
  
  public double getMPG() {
    return 0;
  }
  
  // modifier methods - they change one or more instance fields
  public void addGas(double gas) {
    myGas += gas; // or myGas = myGas + gas;
  }
  
  public void drive(double miles) {
    double gasUsed = miles / myMPG;
    myGas = myGas - gasUsed; // or myGas -= gasUsed;
  }
  
}
