-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
28 lines (22 loc) · 722 Bytes
/
Main.java
File metadata and controls
28 lines (22 loc) · 722 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
public class Main {
public static void main(String[] args) {
ModernCar a = new ModernCar();
//Car b = new Car();
System.out.println("ACCELERATION");
for (int i=0;i<15;i++){
System.out.println("Speed " + a.getCurrentSpeed());
System.out.println("Gear " + a.getGear());
a.accel();
System.out.println("New Speed " + a.getCurrentSpeed());
System.out.println("New Gear " + a.getGear());
}
System.out.println("DECELERATION");
for (int i=0;i<15;i++){
System.out.println("Speed " + a.getCurrentSpeed());
System.out.println("Gear " + a.getGear());
a.decel();
System.out.println("New Speed " + a.getCurrentSpeed());
System.out.println("New Gear " + a.getGear());
}
}
}