Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Parkable: This should be an interface with:a method called park() which: Returns a boolean to note if the Parkable object has been parked

In Java

Parkable:

This should be an interface with:a method called park() which:

Returns a boolean to note if the Parkable object has been parked correctly or not.

a method called unpark() which:

Returns a boolean to note if the Parkable object has been unparked correctly or not.

Auto:

Should implement the Parkable interface.

For park, only return true if the Auto has a permit.

For unpark, always return true (eventually we will add auto boots for cars that are illegally parked)

Bicycle:

Should implement the Parkable interface.

For park, set the Bicycle's attribute for locked to true, then return true;

For unpark, set the Bicycle's attribute for locked to false, then return true;

----------------------------------------------

Static stuff!

The ParkingSpace object will get a static variable for tracking number of parking spaces

Use this static variable to set the number of the parking space in both ParkingSpace constructors

Remove the number parameter from the the Full ParkingSpace Constructor

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

Step: 3

blur-text-image

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions