Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132939 views
License: OTHER
1
//Konstuktor
2
/** erzeugt ein neues Objekt und initialisiert die Attribute */
3
Gears(byte chainwheel0, byte rearsprocket0, int price0) {
4
chainwheel = chainwheel0;
5
rearsprocket = rearsprocket0;
6
price = price0;
7
}
8
9
// Methode
10
/** gibt die Anzahl der Gänge zurück */
11
short getNumberOfGears() {
12
short numbergears;
13
14
numbergears = (short) (rearsprocket * chainwheel);
15
return numbergears;
16
}
17
18