CS计算机代考程序代写 database ER Car

Car
– colour: String {leaf}
– numPassengers: int {leaf}
+ Car(numPassengers: int, colour: String) + toString(): String
ElectricCar
– colour: String {leaf}
– numPassengers: int {leaf}
+ ElectricCar(numPassengers: int, colour: String) + toString(): String
Motorbike
– colour: String {leaf}
+ Motorbike(colour: String) + toString(): String
Scooter
– colour: String {leaf}
+ Scooter(colour: String) + toString(): String
Ute
– colour: String {leaf}
+ Ute(colour: String) + toString(): String
I\I\
I I\ /:\ /:\
1
VehicleApplication
UML class diagram of the original codebase:
– vehicles :List – electricity: boolean
+ main(args: String[l): void – initMenu() :void
– mainMenu(): void
– listVehicles(): void
<>
Vehicle
o..*
addVehicle
– create(}: void
– addVehicle(numPassengers: int, numWheels: int, colour: string): void
V
ViewUtils
+ disQla)’.MenuQ!eader: String, OQtions: String[], QrDffiQt: string): int + getString(QromQt: String): String
+ getlntforomm: String): int
+ getBoolean(QromQt: String): boolean
UML class diagram of refactored database (on next page):

addVehi cl e
+ ElectricCar(numPassengers: int, colour: String) + toString(): String
E l ect r i cC ar F act or y
+ make(electricity: bool, numPassengers: int, numWheels: int, colour: String): Vehicle
<> VehicleFactory
+ make(electricity: bool, numPassengers: int, numWheels: int, colour: String): Vehicle
C ar
– colour: String { leaf}
– numPassengers: int { leaf}
+ Car(numPassengers: int, colour: String) + toString(): String
C ar F act or y
+ make(electricity: bool, numPassengers: int, numWheels: int, colour: String): Vehicle
E l ect r i cC ar
– colour: String { leaf}
– numPassengers: int { leaf}
M ot or b i k e
– colour: String { leaf}
+ Motorbike(colour: String) + toString(): String
M ot or b i k eF act or y
+ make(electricity: bool, numPassengers: int, numWheels: int, colour: String): Vehicle
Scoot er
– colour: String { leaf}
+ Scooter(colour: String) + toString(): String
Scoot er F act or y
+ make(electricity: bool, numPassengers: int, numWheels: int, colour: String): Vehicle
U t e
– colour: String { leaf}
+ Ute(colour: String) + toString(): String
U t eF act or y
+ make(electricity: bool, numPassengers: int, numWheels: int, colour: String): Vehicle
0..*
<>
Vehicle
– vehicles:List – electricity: boolean
+ main(args: String[]): void – initMenu() :void
– mainMenu(): void
1 -listVehicles():void
– create(): void
– addVehi cl e(numPassengers: i nt, numWheel s:
ViewUtils
i nt,
col our:
stri ng): voi d
Vehi cl eA ppl i cat i on
+ displayMenu(header: String, options: String[], prompt: string): int + getString(prompt: String): String
+ getInt(prompt: String): int
+ getBoolean(prompt: String): boolean