Suppose you have a DriverNotReadyException class with the following declaration:
class DriverNotReadyException extends Exception {
public DriverNotReadyException(String message) {
super(message);
}
}
Also, you have the following class Driver:
class Driver {
String name;
Boolean isDoorLocked;
Boolean isBeltFastened;
public void closeDoor() {
this.isDoorLocked = true;
}
public void fastenBelt() {
this.isBeltFastened = true;
}
public void drive(boolean isBeltFastened, boolean isDoorLocked) throws DriverNotReadyException {
//put your code here
}
}
Your task is to write a drive() method which prints to the console the string Here we go if both arguments are true, or otherwise throws the DriverNotReady exception with the message Close the door or fasten your seatbelt