Code Monkey home page Code Monkey logo

upperline-hs-oo-raccoon-puma-todo's Introduction

Raccoons and Pumas, BFFAE

### Step 1: Watch this [YouTube video](https://www.youtube.com/watch?v=vxiSP_ch_oI).

Step 2:

We're going to build two classes. A Raccoon class and a Puma class.

Each instance of the Raccoon class...

  1. Should have 4 attributes: name, age, has_puma_bff?, and puma_points. You can decide which data type each attribute should be.

  2. Should initialize with a unique name and an age.

  3. Should automatically have a puma bff. Set the value has_puma_bff? during initialization.

  4. Starts without any puma_points. Each Raccoon object has to be given puma_points by their puma best friend. Set that value to zero at initialization.

  5. Should be able to talk to it's puma bff. Write a method that allows each raccoon to tell it's best friend, "I love you, Puma Best Friend."

  6. Should be able to give raccoon_points to their puma bff. Create a method called give_raccoon_points. This method should accept any argument (the instance of the Puma class it'll give the points to) and should increment the raccoon_points attribute of the instance of the Puma class.

Each Instance of the Puma Class...

  1. Should have 4 attributes: name, age, has_raccoon_bff?, and raccoon_points. You can decide which data type each attribute should be.

  2. Should initialize with a unique name and an age.

  3. Should automatically have a raccoon bff. Set the value has_raccoon_bff? during initialization.

  4. Starts without any raccoon_points. Each Puma object has to be given raccoon_points by their raccoon best friend. Set that value to zero at initialization.

  5. Should be able to talk to it's raccoon bff. Write a method that allows each puma to tell it's best friend, "I love you, Raccoon Best Friend."

  6. Should be able to give puma_points to their raccoon bff. Create a method called give_puma_points. This method should accept any argument (the instance of the Raccoon class it'll give the points to) and should increment the puma_points attribute of the instance of the Raccoon class.

  7. Finally, Pumas need to be able to drop their best friend, and get another. Create a method called drop_raccoon_bestie. This method should accept an instance of the Raccoon class as an argument. The body of the method should set the has_puma_bff? attribute of the Raccoon class to false.

View Raccoons and Pumas, BFFAE on Learn.co and start learning to code for free.

upperline-hs-oo-raccoon-puma-todo's People

Contributors

dfenjves avatar

Watchers

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