Class Bicycle

java.lang.Object
  
public class Bicycle
extends java.lang.Object

class Bicycle

Version:
1.0
Author:
JP

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

Bicycle

public Bicycle()
Constructor for objects of class Bicycle


Bicycle

public Bicycle(double wheelDiameter,
               int numberOfGears)
Constructor for objects of class Bicycle

Parameters:
numberOfGears -
Method Detail

changeGear

public void changeGear(int direction)
changes value of gear

Parameters:
direction - 0 for down, 1 for up, no change otherwise

changeRpm

public void changeRpm(int pedalRpm)
changes value of pedalRpm

Parameters:
newValue -

getNumberOfGears

public int getNumberOfGears()
gets the value of numberOfGears

Parameters:
newNumber -

speed

public double speed()
calculates the road speed of the bicycle in meters per second