Question: Using the code and UML diagram below, fill in the blanks with the correct keywords or class names. If a keyword is missing from the

Using the code and UML diagram below, fill in the blanks with the correct keywords or class names. If a keyword is missing from the code, fill in the keyword that fits. If the class or data is missing from the UML, fill in the correct information.

Using the code and UML diagram below, fill in the blanks with

public class Vehicle {

_________ int numWheels;

_________ Vehicle(int numWheels)

{

this.numWheels = numWheels;

}

public int getWheels() {

return wheels;

}

}

public class Car _________ Vehicle {

_________ int numDoors;

_________ boolean isElectric;

public Car (int numWheels, int numDoors, boolean isElectric) {

_________(numWheels);

this.numDoors = numDoors;

this.isElectric = isElectric;

}

public int getNumDoors() {

return _________;

}

public boolean getIsElectric() {

return isElectric;

}

}

public class Bicycle _________ Vehicle {

//Mountain bike, road bike, recumbent bike.. etc

_________ String bikeType;

public Bicycle(int numWheels, String bikeType) {

super(numWheels);

this.bikeType = _________;

}

public _________ getBikeType() {

return bikeType;

}

}

public class Convertible _________ Car {

//Soft top or rag top, or hard top

_________ String roofType;

public Convertible(int numWheels, int numDoors, _________ isElectric, String roofType) {

super(numWheels, _________, _________);

this.roofType = roofType;

}

_________ String getRoofType() {

return roofType;

}

}

int numWheels int Bicycle int numDoors; boolean String getBikeType() boolean getlsElectic() Convertible String String getRoofType()

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!