Giter Club home page Giter Club logo

treehouse-driven-development's Introduction

Treehouse Driven Developent

treehouse

What could be better than renting out a beautiful treehouse cabin for the holidays? Your goal is to use Test/Treehouse Driven Development to build out the start of a Treehouse Booking App!

Treehouse Class

Your Treehouse class should meet the following requirements:

  • Have the following properties:

    • price <number>
    • pricePoint <string> (default to empty string)
    • bedrooms <number>
    • bathrooms <number>
    • location <string>
    • isBooked (default to false)
  • Have the following functionality:

    • Be able to have a reduction in price. Passing in a number to this method should decrease the price property by that percent
    • Determine its price point
      • If the price is 100 or less, update the pricePoint to '$'
      • If the price is between 101 and 200, update the pricePoint to '$$'
      • If the price is over 200, update the pricePoint to '$$$'

Write the tests first, and then move on to your implementation code!

Customer Class

Your Customer class should meet the following requirements:

  • Have the following properties:
    • budget <number>
    • bookings (default to an empty array)
  • Have the following functionality:
    • Be able to check their budget. Passing in an instantiation of a treehouse to this method should return a boolean value indicating if they have enough money to book that treehouse or not
    • Be able to book a passed in treehouse if it is in their budget
      • Add to bookings array
      • See their budget decrease by that amount
      • Update the treehouse isBooked property from false to true
    • Not be able to book a passed in treehouse if it is NOT in their budget
      • See an apologetic message
      • Their budget should not decrease

Write the tests first, and then move on to your implementation code!

treehouse-driven-development's People

Contributors

fordo29 avatar hannahhch 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.