Coder Social home page Coder Social logo

oystercard's Introduction

Oystercard Challenge

This week's challenge will start with going back over the basics we covered last week in Boris Bikes, giving you the chance to reinforce what you learned last week. You'll then be challenged to build a more complex system which should really stretch your skills in Ruby, TDD and object-oriented design.

Focus goals

Mindful engagement with these challenges can help you achieve these goals:

I write code that is easy to change
Writing easy to change software is highly prized amongst developers and employers. By developers because most of a developer's time is spent changing software. By employers because their teams can deliver value to customers faster.
I can test-drive my code
Tested software is easier to change because you can tell when it's broken just by running a command, even the tricky edge cases.
I can build with objects
Most code in the world is structured in small pieces called objects. This is done because it is easier to change than having everything in one place.

Weekly challenge user stories

Here are the user stories you will be working on for this project:

In order to use public transport
As a customer
I want money on my card

In order to keep using public transport
As a customer
I want to add money to my card

In order to protect my money
As a customer
I don't want to put too much money on my card

In order to pay for my journey
As a customer
I need my fare deducted from my card

In order to get through the barriers
As a customer
I need to touch in and out

In order to pay for my journey
As a customer
I need to have the minimum amount for a single journey

In order to pay for my journey
As a customer
I need to pay for my journey when it's complete

In order to pay for my journey
As a customer
I need to know where I've travelled from

In order to know where I have been
As a customer
I want to see to all my previous trips

In order to know how far I have travelled
As a customer
I want to know what zone a station is in

In order to be charged correctly
As a customer
I need a penalty charge deducted if I fail to touch in or out

In order to be charged the correct amount
As a customer
I need to have the correct fare calculated

Sequence & Schedule

Set up the project:

  1. Create a Gemfile
  2. Create RSpec conventional files
  3. Review debugging basics

Create a basic Oyster card:

  1. Add the balance
  2. Enable top up functionality
  3. Enforce maximum balance
  4. Deduct the money

Add touch in/out functionality:

  1. Add touch in/out support
  2. Checking mininum balance on touch in
  3. Charging for the journey

Record the journeys

  1. Saving the entry station
  2. Adding journey history
  3. Creating the station class

Refactor to extract Journey class

  1. Handling a journey without a touch out

Refactoring: get the code into shape

  1. Extracting the journey log out of the Oystercard

Make fares depends on zones

  1. Calculating the fare between zones

oystercard's People

Contributors

kierepkak avatar

Watchers

James Cloos avatar Sonny Maan 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.