-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicle.java
More file actions
46 lines (36 loc) · 1.15 KB
/
Copy pathVehicle.java
File metadata and controls
46 lines (36 loc) · 1.15 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
package ass2_1231279_1;
class Vehicle {
private String type;
private String registrationNumber;
private String brand;
private double rentalRatePerDay;
private boolean available;
public Vehicle(String type, String registrationNumber, String brand, double rentalRatePerDay, boolean available) {
this.type = type;
this.registrationNumber = registrationNumber;
this.brand = brand;
this.rentalRatePerDay = rentalRatePerDay;
this.available = available;
}
public String getType() {
return type;
}
public String getRegistrationNumber() {
return registrationNumber;
}
public String getBrand() {
return brand;
}
public double getRentalRatePerDay() {
return rentalRatePerDay;
}
public boolean isAvailable() {
return available;
}
public void setAvailable(boolean available) {
this.available = available;
}
public void printInfo() {
System.out.println(type + " (Registration: " + registrationNumber + "), " + brand + " - $" + rentalRatePerDay + "/day");
}
}