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

How should I start writing a parser for BibTex files. As the initial design
I have read a lot of discussions here on SO, watched Jon Moore's presentation
I am working on the parking lot example, and made few assumptions as I
I have a couple of design/architectural questions that always come up in our shop.
I have recently been exploring the Tornado web framework to serve a lot of
I'm new to design patterns, I have a use case where I need to
Is there a way to find out the assembly name at design-time (i.e. not
I am trying to design a system that will catch emails that are submitted
I have heard that http is a nice way to design my own protocol.
I'm taking a compiler-design class where we have to implement our own compiler (using

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.