java.lang.Object
public class Bicycle
class Bicycle
Constructor Summary | |
---|---|
Bicycle()
Constructor for objects of class Bicycle |
|
Bicycle(double wheelDiameter,
int numberOfGears)
Constructor for objects of class Bicycle |
Method Summary | |
---|---|
void |
changeGear(int direction)
changes value of gear |
void |
changeRpm(int pedalRpm)
changes value of pedalRpm |
int |
getNumberOfGears()
gets the value of numberOfGears |
double |
speed()
calculates the road speed of the bicycle in meters per second |
Methods inherited from class |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Bicycle()
public Bicycle(double wheelDiameter, int numberOfGears)
numberOfGears
- Method Detail |
---|
public void changeGear(int direction)
direction
- 0 for down, 1 for up, no change otherwisepublic void changeRpm(int pedalRpm)
newValue
- public int getNumberOfGears()
newNumber
- public double speed()