Giter Site home page Giter Site logo

suhas-l / bike-rental-system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gurupratap-matharu/bike-rental-system

0.0 0.0 0.0 68 KB

A Bike rental system implemented in python. Customers can rent bikes on hourly, daily and weekly basis.

Python 100.00%

bike-rental-system's Introduction

A Bike Rental System

A full fledged bike rental system implemented in Python using object oriented programming.

Customers can

  • See available bikes on the shop
  • Rent bikes on hourly basis $5 per hour.
  • Rent bikes on daily basis $20 per day.
  • Rent bikes on weekly basis $60 per week.
  • Family Rental, a promotion that can include from 3 to 5 Rentals (of any type) with a discount of 30% of the total price

The rental shops can

  • issue a bill when customer decides to return the bike.
  • display available inventory
  • take requests on hourly, daily and weekly basis by cross verifying stock

Since classes are used various customers and bike rental shops can be instantiated as needed.

For simplicity we assume that any customer requests rentals of only one type i.e hourly, monthly or weekly but is free to chose the number of bikes he/she wants. However requested bikes should be less than available stock.

Unit-Test

Test module is written alongside the main program to rigorously test the classes and methods for errors. Most errors occur in Null values, negative values and non-integer inputs. Most of them have been taken care of.

Incase of discrepancy please raise an issue or feel free to send pull requests.

Running the tests

To run the tests, run the appropriate command below (why they are different):

  • Python 2.7: py.test bikeRental_test.py
  • Python 3.4+: pytest bikeRental_test.py

Alternatively, you can tell Python to run the pytest module (allowing the same command to be used regardle ss of Python version): python -m pytest bikeRental_test.py

Common pytest options

  • -v : enable verbose output
  • -x : stop running tests on first failure
  • --ff : run failures from previous test before running other test cases

For other options, see python -m pytest -h

License

This code is open source. So feel free to use, modify, share, download as per your need. I do not take risk nor responsibility for your errors or any commercial damage.

How to run?

This code is written in python3.6.

Simply run

python main.py

# or depending upon your config

python3 main.py

bike-rental-system's People

Contributors

gurupratap-matharu 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.