GithubHelp home page GithubHelp logo

oo-my-pets-v-000's Introduction

My Pets

Objective

  1. Gain a deeper understanding of object relations.
  2. Build classes that produce objects that interact with one another through associations and behavior.

Instructions

This is a test-driven lab. Use the test file and test output to understand what is being asked of you as you follow the guidelines below.

Overview

You will be building an Owner, Dog, and Cat class. An Owner will know about all their pets, be able to buy a pet, change a pet's mood through walking or feeding it, and sell all of their pets (for when they move to that tiny NYC studio after college).

A Dog and a Cat are initialized with a name and an Owner object

Part I: Object Models

  • Define a Dog and Cat class that have the attributes required by the test suite. Keep in mind, some of the attributes should be readable and writable (i.e. attr_accessors), while others may need to be just setters (attr_writer) or just getters (attr_reader). The test suite will make this clear so pay attention to the test output.

Part II: Object Relations

  • An owner should be able to buy and sell a pet, which will change the pet's mood.

  • When an owner buys a new pet, the buy_cat/buy_dog methods take in an argument of a name. You must take that name and do the following:

    • Make a new instance of the appropriate pet, initializing it with that name and the owner who is purchasing it.
  • An owner should have the ability to walk all their dogs or feed all their cats, which will change the mood of all of their pets of that type to "happy".

These are just a few hints and guidelines to help you through this lab. This lab is extensive and challenging. Rely on the guides here, refer to the previous Code Along on object relations, and read the test output and test files. Never forget to ask a question on Learn if you are stuck. And remember, as a programmer, your job is to fix broken code! Broken code is the norm, the baseline, the starting point for all of the projects you will build. Embrace it!

View OO My Pets on Learn.co and start learning to code for free.

oo-my-pets-v-000's People

Contributors

ahimmelstoss avatar annjohn avatar arelenglish avatar bamsarker avatar curiositypaths avatar donnadieu avatar drakeltheryuujin avatar fislabstest avatar fs-lms-test-bot avatar imkaruna avatar jmburges avatar kthffmn avatar maxwellbenton avatar paulnicholsen27 avatar sarogers avatar sophiedebenedetto avatar victhevenot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oo-my-pets-v-000's Issues

Tests not passing in order

When running the tests in order, they don't pass even though I've technically passed it. I have to do another part of a different test in order for the initial test to past.

For example:
After setting up all the animal classes, the first test is to create a class method where "::all returns all instances of Owner that have been created."
I've done this correctly but it will not pass until I create instance methods for species and initialize it with species.

Especially since you guys are telling us to depend on these tests, I think maybe start with the instance methods tests and then create the class methods? or at the very least, allow us to pass the test without initializing species first? While we are still getting used to these concepts, it helps that we do the tests in order. Thanks!

(Continuing working on the tests and noticed another example: #buy_fish/cat/dog test. the first test for these methods is " can buy a fish that is an instance of the Fish class" and 2nd test is "knows about its fishes." I can't pass the first test until I pass the 2nd test. It gets confusing because it makes it seem like I did the first test incorrectly.)

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.