« All Events
9 AM – Intro To Java
May 23, 2021 @ 9:00 am - 10:00 am
- We continued with Driver system
- We implemented a way where rushHour could reduce the driving speed of the driver by 75%.
- We implemented an override where rushHour could reduce the driving speed of NewYorkTaxiDriver only by 50%.
- We created a new class RacerNYCTaxiDriver which is derived from NewYorkTaxiDriver class and will not be affected during rushHour.
- Homework:
- Create Vehicle class which will have the following attributes
- String name
- boolean commercialVehicle
- int numOfPassenger
- create getters and setters for this class.
- Inside DriverSystem class create List<Vehicle> and add 4 Vehicles in the run method:
- name – Prius, commercialVehicle – false, numOfPassenger – 4
- name – TaxiSedan, commercialVehicle – true, numOfPassenger – 4
- name – TaxiMiniVan, commercialVehicle – true, numOfPassenger – 6
- name – TaxiFullSizeVan, commercialVehicle – true, numOfPassenger – 8
- name – MiniVan, commercialVehicle – false, numOfPassenger – 6
- There is no class next week on May 30 because of memorial day weekend.