Answered step by step
Verified Expert Solution
Link Copied!

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 Part4 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 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 O
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions