-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicleEfficiency.java
More file actions
31 lines (24 loc) · 1.23 KB
/
VehicleEfficiency.java
File metadata and controls
31 lines (24 loc) · 1.23 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
public class VehicleEfficiency {
public static void main(String[] args) {
VehicleType sedan = new VehicleType(VehicleTypeName.SEDAN, 50);
VehicleType suv = new VehicleType(VehicleTypeName.SUV, 40);
VehicleType truck = new VehicleType(VehicleTypeName.TRUCK, 30);
Vehicle takk = new Vehicle("Fjord", "Takk", sedan, 40, 9.5);
Vehicle beklager = new Vehicle("Fjord", "Beklager", sedan, 45, 7.5);
Vehicle vakker = new Vehicle("Fjord", "Vakker", suv, 60, 7.5);
Vehicle stygg = new Vehicle("Fjord", "Stygg", suv, 50, 9.0);
Vehicle vanskellig = new Vehicle("Fjord", "Vanskellig", truck, 60, 8.75);
Vehicle lastebil = new Vehicle("Fjord", "Lastebil", truck, 40, 9.5);
tableHeader();
System.out.println(takk);
System.out.println(beklager);
System.out.println(vakker);
System.out.println(stygg);
System.out.println(vanskellig);
System.out.println(lastebil);
}
private static void tableHeader() {
System.out.println("\nMake\tModel\t\tType\tMPG\tMeets Standards");
System.out.println("=======================================================");
}
}