Ferry Kata

Instructions

Solve this exercise using TDD. Complete it in JavaScript, Python, or Ruby. Once done in one Language in the allotted time try it out in another. Use flowcharts and diagrams to think through the required logic.

A ferry is a boat that carries people and things for a short distance between two places - typically between islands and over rivers.

Ferry The Bolivar Gridge Ferry

Part 1

In an island country far, far, away there are lots of Ferries that allow people to travel 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:

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: