Code Monkey home page Code Monkey logo

zoo's Introduction

Zoo

Using OOP principals, build out the hierarchical class structure of a zoo within Visual Studio and a digital diagram. There should be at least 3 layers of inheritance with at least 6 different types of animals.

Visual

Zoo diagram

OOP Principals

Abstraction

Abstract classes and methods are used a a template usually in the more base levels of the hierarchy. Abstract classes cannot be instantiated.
Examples in Zoo: Abstract classes: Animals, Vertebrates, Invertabrates,...

Inheritance

Inheritance is like a a family tree. You inherit dna, mannerisms, traits, etc from ancestors. The highest class is the base and each class down is a derived class.
Examples in Zoo: Animals is the base class; Vertebrates and Invertabrates are derived from Animals; Reptiles, Birds, Fish, and Mammals are derived from Vertebrates.

Polymorphism

Polymorphism is the ability to change from base classes. Abstract means the first concrete devrived class is required to ovverride the abstract method or property. Virtual means the property or method can be overridden but is not required to be overridden.
Example in Zoo: Abstract Methods/Properties: IsWarmBlooded (property overridden in Mammals Class and Abstract Fish Class), Abstract Method Fly (method overridien in Rattlesnake Class)

Encapsulation

Encaplisation is about using access modifiers to stipulate how data in code can be accessed. The three most popular access modifiers are private, protected, and public.
Examples in Zoo: All are public in Zoo

Interfaces

Interfaces are similar to abstract classes but interfaces can belong to multiple classes and can be implmented by many classes. Interfaces are implemented while abstract classes are overridden.
Examples in Zoo: IAttack and IAmDomesticated are interfaces. IAttack is implemented on the Rattlesnake class. IAmDomesticated is implemented on the Dog class and the Spider class.

zoo's People

Contributors

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