GithubHelp home page GithubHelp logo

dog_walker's Introduction

Dog Walker

Setup

  • Fork this Repository
  • Clone YOUR fork
  • Compete the activity below
  • Push your solution to your fork
  • Include the link to your forked repo in your pre-work gist!

Activity

Iteration 1

Complete Iteration 1 using the following interaction pattern, using TDD:

pry(main)> require './lib/dog'
#=> true

pry(main)> sodie = Dog.new("Sodie", 9, "Shih-Tzu", true)
#=> #<Dog:0x007fe18483fcd0 @name="Sodie", @age=9, @breed="Shih-Tzu", @small_breed=true, @walks=0>

pry(main)> max = Dog.new("Max", 11, "Cocker Spaniel", false)
#=> #<Dog:0x007ff37e818318 @name="Max", @age=11, @breed="Cocker Spaniel", @small_breed=false, @walks=0>

pry(main)> sodie.name
#=> "Sodie"

pry(main)> sodie.age
#=> 9

pry(main)> sodie.breed
#=> "Shih-Tzu"

pry(main)> sodie.small_breed
#=> true

pry(main)> sodie.walks
#=> 0

pry(main)> sodie.bark
#=> "Yap!"

pry(main)> max.bark
#=> "ROOF"

pry(main)> sodie.walk

pry(main)> sodie.walks
#=> 1

pry(main)> sodie.walk

pry(main)> sodie.walks
#=> 2

Iteration 2

Using TDD, create a Walker class that meets the following requirements:

  • Has a name, number of poop bags to start with, and a way to read that data

  • Has a list of clients (starting empty)

  • Has a way to add clients (dog objects)

  • Can walk a dog, which increases that dogs walks and decreases the poop bags the walker has

  • Can count the number of clients (no instance variables allowed!)

  • Can list all puppy clients

  • Can list all elderly clients

  • Can list all client names

  • Can list all client names ending in "y" or "ie"

  • Can check client list for a specific breed

  • BONUS: Make a list of clients, organized by breed. This might look something like:

breed_list =
  { "Shih-Tzu": [oscar, sodie],
    "Cocker Spaniel": [max]
  }
  • BONUS: Make sure the walker can not accidentally add the same client more than once.

dog_walker's People

Contributors

ameseee avatar santiag0c avatar

Watchers

James Cloos 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.