Question: . Use the UML and Notes in the pages below to create the following classes and interfaces: ( 4 pts ) class Person ( 1

. Use the UML and Notes in the pages below to create the following classes and interfaces:
(4 pts) class Person
(1 pt ) class InvalidDriverException extends Exception
(20 pts) class Vehicle
(1 pt ) interface Announcements
(12 pts) class Car extends Vehicle implements Comparable, Announcements
(12 pts) class Bus extends Car
(10 pts) class Bicycle extends Vehicle implements Comparable
Q1 a)(4 pts ) Create the following class Person
class Person
name: String
hasDriverLicense: boolean
age: int //years
height: int //inches
Person(String name, boolean hasDriverLicense, int age, int height)
getName(): String
hasDriverLicense(): boolean
getAge(): int
getHeight(): int
clone() : Person //returns a copy of the Person with all the same values without revealing the original memory address
equals(Object o) : boolean //2 Person objects are equal if all their variables are equal
toString(): String
//"Person [name=%10s | age=%02d | height=%02d | has license/no license]", name, age, height, hasDriverLicense

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!