Class CarJetta

java.lang.Object
  |
  +--CarJetta

public class CarJetta
extends java.lang.Object

This is an example class used in lecture


Constructor Summary
CarJetta(java.lang.String intitialColor)
          The constructor, that sets up the gas tank, and paints car
 
Method Summary
static void changeTankSize(double newTankSize)
          A class method to change gas tank size
 double checkGasLevel()
          A mehtod to return the gas level
 void emptyTank(double gasAmount)
          A mehtod to lower the amount of gas in the tank
 void fillTank(double gasAmount)
          A mehtod to raise the amount of gas in the tank
 java.lang.String getColor()
          A mehtod to return the current car color
static double getTankSize()
          A class method to return the gass tank size
 void paintCar(java.lang.String newColor)
          A mehtod to change the current car color
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CarJetta

public CarJetta(java.lang.String intitialColor)
The constructor, that sets up the gas tank, and paints car

Parameters:
intitialColor - The initial color to paint car
Method Detail

changeTankSize

public static void changeTankSize(double newTankSize)
A class method to change gas tank size

Parameters:
newTankSize - The new size of the tank

getTankSize

public static double getTankSize()
A class method to return the gass tank size

Returns:
The gas tank size

paintCar

public void paintCar(java.lang.String newColor)
A mehtod to change the current car color

Parameters:
newColor - The new car color

getColor

public java.lang.String getColor()
A mehtod to return the current car color

Returns:
The current car color

fillTank

public void fillTank(double gasAmount)
A mehtod to raise the amount of gas in the tank

Parameters:
gasAmount - An amount of gas to add to tank

emptyTank

public void emptyTank(double gasAmount)
A mehtod to lower the amount of gas in the tank

Parameters:
gasAmount - An amount of gas to remove from tank

checkGasLevel

public double checkGasLevel()
A mehtod to return the gas level

Returns:
The amount of gas in tank