Code Monkey home page Code Monkey logo

ferrykata's Introduction

Ferry Kata

Instructions

Solve the Kata below using TDD. Complete it in Javascript, Python, or Ruby. Once done in one Language in the alotted time try it out in another. Use flowcharts and diagrams to think through the required logic.

Part 1

Ferry The Bolivar Gridge Ferry

In an island country far far away there are lots of Ferries that allow people to travel easily by car between all the different islands of this country.

This country's government would like to control the number of cars and people that can get onto a Ferry.

To help them they need you to:

  • Create a Car class: the constructor should specify the colour and the number of passengers in the car.

  • Create a Ferry class: the constructor should specify the number of cars allowed on the ferry and also how many people are allowed on the ferry.

Cars are allowed onto the Ferry using the board method. If the ferry is not full yet the board method returns 'accepted'. If there are enough people or cars on the Ferry already, the board method should return 'rejected'.

The Ferry class instance should keep track of the number of people and cars on the Ferry using the people_count and car_count properties.

Part 2

Once you can load cars into the Ferry, look at other things the Ferry company is interested in:

  • knowing how many cars of a certain color are on the Ferry;
  • updating the people and car counts correctly when a car leaves the Ferry;
  • giving a car 50% discount after three trips on the same ferry. The board method should return 'half price!';
  • giving a free trip after 7 trips on any Ferry. The board method should return 'you go free!'

ferrykata's People

Contributors

codex-avee avatar stevebarnett avatar

Watchers

 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.