-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMain.java
More file actions
50 lines (42 loc) · 1.55 KB
/
Main.java
File metadata and controls
50 lines (42 loc) · 1.55 KB
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
package fuelpurchase;
import java.util.*;
/**
*
* @author 041209329
*/
public class Main {
/**
* @param args
*/
// Jean and Gerald's work
public static void main(String[] args) {
// Jean came up with a title the looks appropriate to this program
System.out.println(" >>> THE FUEL ECONOMY <<<");
System.out.println("Audio A6, Jaguar X200 & Mercedes-Benz CL600 C220");
System.out.println("------------------------------------------------");
// Gerald add new vehicles
Vehicle A = new Vehicle("Audi", "A6", 2014);
Vehicle J = new Vehicle ("Jaguar", "X200", 2013);
Vehicle M = new Vehicle ("Mercedes-Benz", "CL600-C220", 2014);
A.printDetails();
// Jean added names for each vehicle and there codes
// Vehicle A distance
for (int i = 0; i < 10; i++) {
A.addKilometers(new Random().nextInt(100));
}
System.out.println("\n\n");
A.printDetails();
// Vehicle J distance
for (int i = 0; i < 10; i++) {
J.addKilometers(new Random().nextInt(100));
}
System.out.println("\n\n");
J.printDetails();
// Vehicle M distance
for (int i = 0; i < 10; i++) {
M.addKilometers(new Random().nextInt(100));
}
System.out.println("\n\n");
M.printDetails();
}
}