Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 175631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:44:00+00:00 2026-05-11T13:44:00+00:00

Design an OO parking lot. What classes and functions will it have? It should

  • 0

Design an OO parking lot. What classes and functions will it have? It should say, full, and empty and also be able to find a spot for Valet parking. The lot has 3 different types of parking: regular, handicapped, and compact.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:44:00+00:00Added an answer on May 11, 2026 at 1:44 pm

    Here is a quick start to get the gears turning…

    ParkingLot is a class.

    ParkingSpace is a class.

    ParkingSpace has an Entrance.

    Entrance has a location or more specifically, distance from Entrance.

    ParkingLotSign is a class.

    ParkingLot has a ParkingLotSign.

    ParkingLot has a finite number of ParkingSpaces.

    HandicappedParkingSpace is a subclass of ParkingSpace.

    RegularParkingSpace is a subclass of ParkingSpace.

    CompactParkingSpace is a subclass of ParkingSpace.

    ParkingLot keeps array of ParkingSpaces, and a separate array of vacant ParkingSpaces in order of distance from its Entrance.

    ParkingLotSign can be told to display ‘full’, or ’empty’, or ‘blank/normal/partially occupied’ by calling .Full(), .Empty() or .Normal()

    Parker is a class.

    Parker can Park().

    Parker can Unpark().

    Valet is a subclass of Parker that can call ParkingLot.FindVacantSpaceNearestEntrance(), which returns a ParkingSpace.

    Parker has a ParkingSpace.

    Parker can call ParkingSpace.Take() and ParkingSpace.Vacate().

    Parker calls Entrance.Entering() and Entrance.Exiting() and ParkingSpace notifies ParkingLot when it is taken or vacated so that ParkingLot can determine if it is full or not. If it is newly full or newly empty or newly not full or empty, it should change the ParkingLotSign.Full() or ParkingLotSign.Empty() or ParkingLotSign.Normal().

    HandicappedParker could be a subclass of Parker and CompactParker a subclass of Parker and RegularParker a subclass of Parker. (might be overkill, actually.)

    In this solution, it is possible that Parker should be renamed to be Car.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Think Design: I have many applications that share the same user database! Other tables
Program design: Class A, which implements lower level data handling Classes B-E, which provide
i design one form for registration of users. in that i use tag in
I design new IntSet Class that use ArrayList. first, i extends Intset by ArrayList
Task: Design a class that is a collection of other objects and could be
The design I've come up with for filtering is awkward at best, and buggy
How do I design a scheme such this in MongoDB? I think there are
I am trying to design a database strcuture for a questionnarie, and then an
how to Design a QTWidget Form using QTCreator at Design Time ? I want
I am planning to design a video game by myself as a hobby. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.