Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Object Oriented Approach Program Part 4 i am continue to asking the language is Java Write a test program in which the following are performed
Object Oriented Approach Program Part i am continue to asking the language is Java Write a test program in which the following are performed in order.
a Create a new CarPark object with the capacity of and the hourly price of
TLs
b Create vehicles with different license plate numbers and the following sizes:
c These vehicles should try to enter to the car park with onehour delays.
You may assume that the first car will be entered in current time.
If the current time is Fri Dec :: then the second car will be
entered at Fri Dec :: the third car will be entered at Fri Dec
:: 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 YourNumberHWzip
ex: HWzip to Canvas system under Assignments tab
Your zip file should contain the following files:
Java source files: Vehicle.java, ParkPlace.java, Ticket.java, CarPark.java,
Test.java
Java class files: Vehicle.class, ParkPlace.class, Ticket.class, CarPark.class,Object O
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started