|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.ObjectTollLane
public class TollLane
This class simulates a toll road that lets people drive their cars through if they pay some money, but then flags them as violators if they don't pay enough!
| Constructor Summary | |
|---|---|
TollLane()
This method is the public constructor for the TollLane class. |
|
| Method Summary | |
|---|---|
int |
getCars()
This method returns the total number of cars that entered the toll lane. |
double |
getCash()
This method returns the total amount of cash remaining. |
int |
getViolators()
This method returns the total number of cars violators who entered the toll lane. |
void |
letCarPass(double amount)
This method lets cars pass on payment of a fee (of their choosing, apparently). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TollLane()
| Method Detail |
|---|
public int getCars()
public double getCash()
public int getViolators()
public void letCarPass(double amount)
amount - the amount paid by the currently passing car
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||