Computer Science, asked by hayakhan139, 4 months ago

define an abstract class called parking space which includes an abstract method ShowSpaceType to show the type of parking space​

Answers

Answered by sh123prajapat
1

Explanation:

Define an abstract class called ParkingSpace, which includes an abstract method showSpaceType to show the type of the parking space. ... Add a constructor which makes a handicapped parking space with a given space number. Override the abstract method showSpaceType to show this is a "Handicapped Parking Space".

Answered by mahi946535
1

Answer:

1. Define an abstract class called ParkingSpace, which includes an abstract method showSpaceType to show the type of the parking space.

2. Define a class RegularParkingSpace, which is a derived class of ParkingSpace.

a. Add a constructor which makes a regular parking space with a given space number. Override the abstract method showSpaceType to show this is a "Regular Parking Space".

3. Define a class HandicappedParkingSpace, which is a subclass of ParkingSpace.

a. Add a constructor which makes a handicapped parking space with a given space number. Override the abstract method showSpaceType to show this is a "Handicapped Parking Space".

4. Define a class ParkingLot. A parking lot generally has a number of parking spaces. (You are asked to use composition).

Similar questions