Q: Discuss about a UML Diagram by updating it and putting it into Java Code.:
Car object class:
1. What does CAR object know?
The CAR object should know about
a. Its direction to move
b. Its Speed limit(min and max)
c. Gear limit
d. Break capacity
e. Engine status
2. What can a CAR object do?
The functions of CAR are
a. Move (front and back)
b. Start Engine
c. Stop Engine
d. Increase Gear
e. Decrease Gear
f. Stop or slow down using Break
Car Object
- __accelerationTime: float
- __acceleration: float
- __breakAcceleration: float
- __gear: int
- __gearUpshifted: Boolean
- __maxGear: int
- __position: float
- __speed: float
- __started: boolean
+ setAccelerationSpeed(speed: Float):
+ getAccelerationSpeed() : Float
+ displaySpeed()
+ brake()
+ setDownshiftGear(gear: Int)
+ getDownshiftGear() : Int
+ startEngine(): int
+ stopEngine(): int
+ toString(): String
+ upshiftGear(): int.