forked from ab-rohman/Open-Hack2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MotorDemo.java
55 lines (39 loc) · 1.28 KB
/
MotorDemo.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Nama : Muhammad Rizqi Ardiansyah
* Kelas : MI 2D
* Absen : 19
* NIM : 2031710041
*/
public class MotorDemo {
public static void main(String[] args) {
Motor motor = new Motor();
motor.printStatus();
motor.tambahKecepatan();
motor.nyalakanMesin();
motor.printStatus();
System.out.println("=====================");
System.out.println("| Tambah kecepatan |");
System.out.println("=====================");
motor.tambahKecepatan();
motor.printStatus();
motor.tambahKecepatan();
motor.printStatus();
motor.tambahKecepatan();
motor.printStatus();
motor.tambahKecepatan();
motor.printStatus();
System.out.println("=====================");
System.out.println("| Kurangi kecepatan |");
System.out.println("=====================");
motor.kurangiKecepatan();
motor.printStatus();
motor.kurangiKecepatan();
motor.printStatus();
motor.kurangiKecepatan();
motor.printStatus();
motor.kurangiKecepatan();
motor.printStatus();
motor.matikanMesin();
motor.printStatus();
}
}