class Bicycle {
constructor(owner, color) {
this.cadence = 0;
this.speed = 0;
this.gear = 1;
this.owner = owner || "no name";
this.color = color || "unknown color";
}
changeCadence(newValue) {
this.cadence = newValue;
}
changeGear(newValue) {
this.gear = newValue;
}
speedUp(increment) {
this.speed = this.speed + increment;
}
applyBrakes(decrement) {
this.speed = this.speed - decrement;
}
printStatus() {
return("Cadence:"+this.cadence+"\n" +
"Speed:" + this.speed + "\n" +
"Gear:" + this.gear + "\n" +
"Color:" + this.color + "\n" +
"Name Tag:" + this.owner + "\n" )
}
}