Question: answer quickly. java 2 nts] points] Fall 202 Implement the class Car only. The code of the classes Vehicle and Truck is provided below. Vehicle

answer quickly. java 2  answer quickly. java 2 nts] points] Fall 202 Implement the class
Car only. The code of the classes Vehicle and Truck is provided

nts] points] Fall 202 Implement the class Car only. The code of the classes Vehicle and Truck is provided below. Vehicle -brand: String -year: int +Vehicle ---All Parameters--- ) +toString() String Car Truck -noPassengers: int -loadCapacity: double +Car(--- All Parameters---) +Truck (--- All Parameters--- + describeSize(): void +equals(o: Object): +getLoadCapacity(): double public boolean class +toString(): String Vehicle +toString(: String private String brand: private int year; public Vehicle (String brand, int year) this.brand-brand; this year = year; public String toString() { return "Vehicle" + "brand=" + brand + year public clase Truck extends Vehicle years public class Truck extends Vehicle private double loadCapacity: public Truck(double loadCapacity, String brand, int year) super (brand, year); this.loadCapacity - load capacity: public double getLoadcapacity return load capacity public String toString) return "Truck" + "loadCapacity" + load capacity : ) Implement the class Car by writing the following methods: Page 4 of 5 CSC1300 Final Makeup Exam Fall 2020 - 2021 a) The constructor takes all parameters, 15 pts! b) The method describe Size displays "Small if the number of passengers is four or less, "Medium" if the number of passengers is five and "Large" otherwise. 15 pts c) The method equals which overrides the equals method of the Object class is used to check if two Car objects are equal based on the number of passengers 15 pts d) The toString method returns the description of the Object including all attributes. 15 pts]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!