Question: Object Oriented Approach Problem PART 4 Write a test program in which the following are performed in order. a . Create a new CarPark object

Object Oriented Approach Problem PART4 Write a test program in which the following are performed in order.
a. Create a new CarPark object with the capacity of 10 and the hourly price of 5
TLs.
b. Create 5 vehicles with different license plate numbers and the following sizes:
4,2,1,2,4.
c. These vehicles should try to enter to the car park with one-hour delays.
You may assume that the first car will be entered in current time.
If the current time is Fri Dec 1503:02:20, then the second car will be
entered at Fri Dec 1504:02:20, the third car will be entered at Fri Dec
1505:02:20, etc.
d. Assume that the car park is filled with the first four vehicles and there is no space
for the fifth one.
e. Print the content of vehicle list at that time.
Invoke printVehicleList method of CarPark object.
f. After a while, two vehicles exit from the car park (you can pick a random value for
the total number of hours).
g. Invoke the printVehicleList method of the CarPark object.
h. After a while, remaining vehicles exit from the car park.
i. Print the total income earned until now by calling the getTotal Income method
of the CarPark object.
j. Print the total number of tickets processed until now by accessing the
numberOfTicket field of the Ticket class.
k. Print the details of each tickets by invoking printTickets method of CarPark
object.
This is a simple scenario to test your class implementations. There might be other test cases too.
Therefore, please pay attention to use the same class, method and variable names in your
implementations. You are allowed to increase the number of methods in the classes; however, you
cannot decrease the number of them. You are not allowed to use ArrayLists in the homework! You can
only use Arrays.
Submission Instructions
Please zip and submit your files using filename YourNumberHW4.zip
(ex: 150713852HW4.zip) to Canvas system (under Assignments tab).
Your zip file should contain the following 10 files:
5 Java source files: Vehicle.java, ParkPlace.java, Ticket.java, CarPark.java,
Test.java
5 Java class files: Vehicle.class, ParkPlace.class, Ticket.class, CarPark.class,
 Object Oriented Approach Problem PART4 Write a test program in which

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 Programming Questions!