Question: object - oriented approach problem part 1 , the language is Java. We cannot use these and similar ones ( So we should simplify them
objectoriented approach problem part the language is Java. We cannot use these and similar ones So we should simplify them and write them in detail.:
strsplit strreplaceFirst strreplaceAll strreplace append strhashCode StringBuilder strictly forbidden any specific function or method
It is allowed to use:
lowerCase upperCase str str concat lastIndexOfch fromIndex lastIndexOfs lastIndexOfs fromIndex strsubstring substringbeginIndex substringbeginIndex endIndex strstartsWith strendsWith strcontains strequalsstr and so on Implement a Vehicle class with the following UML diagram.
A Vehicle object represents a vehicle with a license plate number and size.
The data field of size may take the values of and
You may simply assume that : motorcycle, : car, : truck
You have to use this keyword in the implementation of the constructor.
Consider the following example which demonstrates the creation of a Vehicle object:
Vehicle vehicle new Vehicle CSE;
getPlateNumber method should return the plate number of the vehicle.
getSize method should return the size of the vehicle.
getVehicleinfo method returns a string containing the vehicle's license plate
number and the size of the vehicle.
An example string as the following:
Vehicle Info
Plate Number : CSE
Size :
Implement a ParkPlace class with the following UML diagram.
A ParkPlace object represents a suitable place that the vehicle will be parked.
A ParkPlace object is created with a size of the vehicle and the vehicle itself.
You have to use this keyword in the implementation of the constructor.
Consider the following example which demonstrates the creation of a ParkPlace
object:
ParkPlace parkPlace new ParkPlace vehicle;
getSize method returns the size of the ParkPlace object.
The size of the ParkPlace might be suitable for a motorcycle, a car, or a truck.
getVehicle method returns the Vehicle object of the ParkPlace object.
This represents which vehicle is parked in that place.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
