/* This class describes a vehicle with the following attributes and methods! */

public class Vehicle {

	private String regNbr;
	private String model; 
	private String type; // What kind of vehicle...
	private String licenseReq; // What license is required to drive it...
	private int price; // Rental price per day...
	private String info; // General information about the vehicle
	private boolean hasHook; // If the vehicle is able to pull lorries...
	private String expiryDate; // When it should be sold!
	private Warehouse warehouse; // Where the vehicle is located!

	public Vehicle(String regNbr, String model, String type, String licenseReq,
				   int price, String info, boolean hasHook, 
				   String expiryDate, Warehouse warehouse) {
		
		this.regNbr = regNbr;
		this.model = model;
		this.type = type;
		this.licenseReq = licenseReq;
		this.price = price;
		this.info = info;
		this.hasHook = hasHook;
		this.expiryDate = expiryDate;
		this.warehouse = warehouse;
	}

	public String getRegNbr() {
		return regNbr;
	}

	public void setRegNbr(String regNbr) {
		this.regNbr = regNbr;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getLicenseReq() {
		return licenseReq;
	}

	public void setLicenseReq(String licenseReq) {
		this.licenseReq = licenseReq;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	public boolean isHasHook() {
		return hasHook;
	}

	public void setHasHook(boolean hasHook) {
		this.hasHook = hasHook;
	}

	public String getExpiryDate(){
		return expiryDate;
	}

	public void setExpiryDate(String expiryDate){
		this.expiryDate = expiryDate;
	}
	
	public Warehouse getWarehouse(){
		return warehouse;
	}

	public void setWarehouse(Warehouse warehouse){
		this.warehouse = warehouse;
	}
}

@@ -74,16 +74,45 @@
 ds! */%0A%0A
+import java.util.ArrayList;%0A%0A
 public c
@@ -124,16 +124,32 @@
 Vehicle 
+extends Product 
 %7B%0A%0A%09priv
@@ -609,16 +609,103 @@
 located!
+%0A%09private ArrayList%3CString%3E datesBooked; // A list containing dates when it's booked...
 %0A%0A%09publi
@@ -1096,32 +1096,78 @@
 se = warehouse;%0A
+%09%09this.datesBooked = new ArrayList%3CString%3E();%0A
 %09%7D%0A%0A%09public Stri
@@ -2212,24 +2212,24 @@
 warehouse)%7B%0A
-
 %09%09this.wareh
@@ -2249,10 +2249,453 @@
 use;%0A%09%7D%0A
+%09%0A%09public boolean isBookable(String date) %7B // Method to check if a car is bookable!%0A%09%09for(int a = 0; a %3C datesBooked.size(); a++) %7B // Checks the whole list...%0A%09%09%0A%09%09%09if(datesBooked.get(a).equals(date)) %7B // If there is a date which matches our date...%0A%09%09%09%09return false; // ... it's not available for booking!%0A%09%09%09%7D%0A%09%09%7D %0A%09%09datesBooked.add(date); // Since there is no date, add it and...%0A%09%09return true; // ... make it available for booking! %0A%09%7D%0A
 %7D%0A

Update Vehicle.java