forked from ab-rohman/Open-Hack2021
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSepeda.java
More file actions
32 lines (26 loc) · 702 Bytes
/
Copy pathSepeda.java
File metadata and controls
32 lines (26 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
*
* @author Rizqi Ardiansyah
*/
public class Sepeda {
private String merek;
private int kecepatan;
private int gear;
public void setMerek(String newValue) {
merek = newValue;
}
public void gantiGear(int newValue) {
gear = newValue;
}
public void tambahKecepatan(int increment) {
kecepatan = kecepatan + increment;
}
public void rem(int decrement) {
kecepatan = kecepatan - decrement;
}
public void cetakStatus() {
System.out.println("Merek: " + merek);
System.out.println("Kecepatan: " + kecepatan);
System.out.println("Gear: " + gear);
}
}