Displaying 1 result from an estimated 1 matches for "setgear".
Did you mean:
netgear
2008 Feb 05
2
help with oop in R - class structure and syntex
...public Bicycle(int startCadence, int startSpeed, int startGear) {
gear = startGear;
cadence = startCadence;
speed = startSpeed;
}
// *the Bicycle class has four methods*
public void setCadence(int newValue) {
cadence = newValue;
}
public void setGear(int newValue) {
gear = newValue;
}
public void applyBrake(int decrement) {
speed -= decrement;
}
public void speedUp(int increment) {
speed += increment;
}
}
Could one of the R experts please illustrate the R class syntex for writing
the R equivalent...