Class CarDoc

java.lang.Object
  extended by CarDoc

public class CarDoc
extends java.lang.Object

The CarDoc class models some very basic information and functions of a car

Author:
Eric Heim

Constructor Summary
CarDoc(int inYearModel, java.lang.String inMake, java.lang.String inModel)
          Initializes the attributes to the parameters and speed to 0
 
Method Summary
 void accelerate()
          Increases the speed attribute by 5 (MPH)
 void brake()
          Decreases the speed attribute by 5 (MPH).
 java.lang.String getMake()
          Make getter
 java.lang.String getModel()
          Model getter
 int getSpeed()
          speed getter
 int getYearModel()
          Year model getter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CarDoc

public CarDoc(int inYearModel,
              java.lang.String inMake,
              java.lang.String inModel)
Initializes the attributes to the parameters and speed to 0

Method Detail

getYearModel

public int getYearModel()
Year model getter

Returns:
yearModel Attribute

getMake

public java.lang.String getMake()
Make getter

Returns:
make attribute

getModel

public java.lang.String getModel()
Model getter

Returns:
model attribute

getSpeed

public int getSpeed()
speed getter

Returns:
speed attribute

accelerate

public void accelerate()
Increases the speed attribute by 5 (MPH)


brake

public void brake()
Decreases the speed attribute by 5 (MPH). If the current speed is less than 5, the speed is set to 0.