Due Date:
Friday, 26 February 2021
File(s) to be submitted:
Vehicle.java, Truck.java
Sample Output:
SampleOutput.html
Starter Files:
Create a Vehicle class and a Truck class derived from it. Use the provided driver program to test your classes. The driver program does no input -- other than requiring the user to press the Enter key once. It merely prints out some messages, including (eventually) PASS/FAIL messages about some tests it is carrying out.When you look at the code for the driver program, you will notice that quite a lot of it is commented out. You can activate parts of the code by deleting the indicated lines. Do not revise the driver program except to delete the lines indicated. Only delete those lines when you've completed created the corresponding class (along with stubs for the required methods). At that point you should be able to compile and run the driver program and see whether your methods are working properly.
The sections of TruckDriver are for:
- the Vehicle class
- the Truck class
- error checking on classes In general, methods should throw IllegalArgumentExceptions when given illegal arguments.
For this assignment you need to create two files. One represents a generic vehicle, and the other a truck -- which is a particular kind of vehicle. Your Vehicle class must record the following information: