GithubHelp home page GithubHelp logo

py-aquapark's Introduction

Aqua-park

Read the guideline before starting.

You are a visitor of aqua-park. There are several slides with different limitations of height, weight and age. Let's create a system that determines whether a visitor can use the slide depending on the own parameters.

To implement it, create the following classes:

1. IntegerRange class - descriptor for parameters limitations

Its __init__ method takes 2 values and stores them:

  • min_amount - min integer accessible value of the visitor's parameter
  • max_amount - max integer accessible value of the visitor's parameter

Create __get__(), __set__() and __set_name__() methods.

2. Visitor class that is responsible for the user's personal data

Its __init__ method takes name, age, weight, and height.

3. SlideLimitationValidator class, inherited from ABC class

Its __init__ method takes age, weight, and height.

4. ChildrenSlideLimitationValidator and AdultSlideLimitationValidator classes, it's a limitation validators for slides

Aqua-park has two types of slides: for adult and for children.

ChildrenSlideLimitationValidator class and set values:

  • age in range of 4 and 14
  • height in range of 80 and 120
  • weight in range of 20 and 50

AdultSlideLimitationValidator class and set values:

  • age in range of 14 and 60
  • height in range of 120 and 220
  • weight in range of 50 and 120

5. Slide class

Its __init__ method takes 2 arguments:

  • name - string value, slide's name
  • limitation_class - type of SlideLimitationValidator class which sets restrictions on the use of the slide

Create can_access method that takes instance of Visitor class and returns if the visitor can use the slide.

py-aquapark's People

Contributors

abnormaltype avatar arsen-pidhoretskyi avatar nattalli avatar y-havryliv avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.