In this project, you will practice the skills involved in Object Oriented Programming

Overview

Object Zoo

In this project, you will practice the skills involved in Object Oriented Programming. To achieve this, you will create a Zoo with a few different types of animals:

  • Cats
  • Lions
  • Deer
  • Moose, and
  • Chimpanzee

For each of these and the Zoo you will need to design a class with the appropriate fields, methods, and constructors.

Class Descriptions

Below is the API for each class you will need to design for this project. You will also need the Javadocs for the included Color class.

Zoo

All fields of the Zoo should be private. it should also implement the following API.

public int countAnimls(){} //returns the number of animals in the Zoo.
public void addCat(Cat x){} //Adds the given Cat to the Zoo.
public void addLion(Lion x){} //Adds the given Lion to the Zoo.
public void addDeer(Deer x){} //Adds the given Deer to the Zoo.
public void addMoose(Moose x){} //Adds the given Moose to the Zoo.
public void addChimpanzee(Chimpanzee x){} //Adds the given Deer to the Zoo.
public Moose mateMoose(Moose a, Moose b){} //Returns a new Moose of random sex and a Color the average of the two parent Moose.
public ArrayList<Object> getAllAnimlas(){} //Returns an ArrayList containing all the animals in the Zoo.

Animals

Animals should also have only private fields. They should also all have the following methods:

public Color getColor(){} //Returns the Color of the animal.
public int getWeight(){} //Returns the Weight of the given animal.
public void eat(int w){} //Causes the animal to eat and increases its weight by w.
public boolean isMale(){} //Returns if the animal is male.
public boolean isFemale(){} //For gender equality returns if the animal is female.
public void speak(){} //Returns the speech of the animal according to its definition.
public static int population(){} returns the number of animals of that class (or its subclasses) that have been created.

Speak() method

The following is a description of how each animal should speak.

  • Cat prints "Meow!" to the terminal.
  • Lion prints "Roar!" to the terminal.
  • Deer prints "Deer Sounds!" to the terminal.
  • Moose prints "Moose Sounds!" to the terminal.
  • Chimpanzee prints "Oo oo aa aa!" to the terminal.

Printing is always done on its own line.

Overriding Methods

When one method overrides the method of a parent class, the @Override tag should be used directly above the method heading. The speak() method in particular should always override its superclass (when there is one).

When possible classes should inherit and not override their parent's method.

Constructors

Your zoo and animal classes should all have no-args constructors. Additionally, each animal should have at least a constructor which takes only a Color, for example:

public Moose(Color x) //returns a Moose of the given color.
You might also like...

A sideproject to learn more about object-oriented programming, design patterns and Java meanwhile studying an OOP-course.

MyBank Description A console application that simulates a bank with very simple functions. Potential story could be an employee using this application

Mar 23, 2022

Initial example of Object Oriented Programming, with Java

Initial example of Object Oriented Programming, with Java

Programación - Alumnos Clase Ejemplo inicial de Programación Orientada a Objetos, con Java. Nuestra primeras clases, con usos, abusos, y algunos tests

Dec 27, 2022

A GUI-based file manager based on a Java file management and I/O framework using object-oriented programming ideas.

A GUI-based file manager based on a Java file management and I/O framework using object-oriented programming ideas.

FileManager A GUI-based file manager based on a Java file management and I/O framework using object-oriented programming ideas. Enables folder creatio

Feb 7, 2022

Three Java projects assigned for the Introduction to Object-Oriented Programming (CMPE 160) course in the Spring 2021 semester.

CMPE160-projects Three Java projects assigned for the Introduction to Object-Oriented Programming (CMPE 160) course in the Spring 2021 semester. These

Dec 6, 2022

For Jack language. Most of codes were commented with their usage, which can be useful for beginner to realize the running principle of a compiler for object-oriented programming language.

Instructions: Download the Java source codes Store these codes into a local folder and open this folder Click the right key of mouse and click ‘Open i

Jan 5, 2023

Dalek’s Game is a Java project for Object-Oriented Technologies classes

Dalek’s Game is a Java project for Object-Oriented Technologies classes

Dalek’s Game is a Java project for Object-Oriented Technologies classes. The goal of the game is to survive and eliminate Daleks (who are the enemies) from the board. Each time the main character (Doctor) moves, every Dalek follows him. When a Dalek bumps into another Dalek or junk, it becomes junk. When there is no Dalek left on the map, Doctor wins.

Feb 7, 2022

This is a basic Java project focused on applying object-oriented design in a real world application

Email-Administration-System-in-Java This is a basic Java project focused on applying object-oriented design in a real world application. Email Adminis

Feb 4, 2022

The place to come for pair programming practice problems in your language, designed for new and old developers alike.

Coding Dojo About The Coding Dojo is a project and weekly meetup hosted by Code Connector to offer opportunities for learning, mentoring, and practici

Nov 18, 2022

dOOv (Domain Object Oriented Validation) a fluent API for type-safe bean validation and mapping

dOOv (Domain Object Oriented Validation) dOOv is a fluent API for typesafe domain model validation and mapping. It uses annotations, code generation a

Nov 20, 2022

True Object-Oriented Java Web Framework

True Object-Oriented Java Web Framework

Project architect: @paulodamaso Takes is a true object-oriented and immutable Java8 web development framework. Its key benefits, comparing to all othe

Dec 23, 2022

Object-Oriented Java primitives, as an alternative to Google Guava and Apache Commons

Project architect: @victornoel ATTENTION: We're still in a very early alpha version, the API may and will change frequently. Please, use it at your ow

Dec 27, 2022

Object-oriented Java tuples

Object oriented Java tuples. No data accessors No ugly class or method names pair._1() , new Tuple3() All tuple types are interfaces Strong encapsulat

Feb 7, 2022

Design Patterns: Elements of Reusable Object-Oriented Software

GoF Design Patterns Design Patterns: Elements of Reusable Object-Oriented Software Task 싱글톤패턴 싱글톤 패턴 구현 방법을 깨뜨리는 방법 리플렉션을 통해 싱글톤 패턴을 깨뜨리다 역직렬화를 통해 싱글톤

Jul 19, 2022

Survey for object-oriented languages

Project architect: baudoliver7 What does it do ? It helps to select OO languages for a survey. Pre-requisites JDK 1.8 or + Maven 3.1.0 or + How does i

Dec 15, 2021

dOOv (Domain Object Oriented Validation) a fluent API for type-safe bean validation and mapping

dOOv (Domain Object Oriented Validation) dOOv is a fluent API for typesafe domain model validation and mapping. It uses annotations, code generation a

Nov 20, 2022

An object-oriented implementation of the game Concentration

Concentration An object-oriented implementation of the game Concentration Rules Any deck of playing cards may be used, although there are also commerc

Dec 6, 2022

Object-Oriented and Immutable Java Chain of XSL Transformations

It's a chain of XSL transformations in Java. You add this to your pom.xml: dependency groupIdcom.yegor256/groupId artifactIdxsline/artifa

Dec 15, 2022
Owner
null
Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners.

Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners. If You Have any doubt or query you can ask me here or you can also ask me on My LinkedIn Profile

Shaikh Minhaj 3 Nov 8, 2022
Learning and improving skills in Object Oriented Programming, with concepts from the Spotify App

sPOOtify Screenshot EN A project developed in the discipline of Object Oriented Programming, to apply and improve the concepts of Object Orientation.

Eduardo Henrique 7 Jan 2, 2023
Challenge: Learn Object Oriented Programming in Practice

Challenge: Learn Object Oriented Programming in Practice The main objective is to put into practice one of the main tools of OO: ABSTRACTION, ENCAPSUL

njtsb1 0 Sep 4, 2022
It is a simple java terminal game. I built it in order to practice my code skills that I obtained while I was learning Java.

Java-terminal-game It is a simple java terminal game. I built it in order to practice my code skills that I obtained while I was learning Java. The ga

Baistan Tashkulov 0 Jan 20, 2022
MCQs and coding questions solutions of Object-Oriented Programming java of coding ninjas

cn-java-sols (⌐■_■) Link to This repository Other similar repository of my friend Link ?? enjoy having full marks ?? ?? now answers avaible up to Stri

Sanyam Mahajan 11 Dec 27, 2022
Teaching materials for Algorithm Bootcamp: Object-Oriented Programming.

Object Oriented Programming Materials Materials Topics Code Introduction to Java Variables and Data Types Operators I/O Selection and Repetition 00_in

Elvan Selvano 17 Nov 8, 2022
A simple banking system written in Java used to teach object-oriented programming and best coding practices.

didactic-bank-application A simple banking system written in Java used to teach object-oriented programming and best coding practices. It is a three-l

Ingrid Nunes 32 Aug 28, 2022
Object Oriented Programming Course - Fall Semester 2021

Object Oriented Programming Course (Fall Semester 2021) This repository will store the code we use during the lectures and the exercises sessions of t

Andres R. Masegosa 14 Jul 10, 2022
👨‍🏫ITMO University first 4 labs. They are about object oriented programming and Java language

Java-Programming-1st-semester 1st lab - math operations, formatted output. 2nd lab - object oriented programming. 3rd lab - SOLID and STUPID principle

Andrey Vasiliev 4 Dec 1, 2022
PGR112 Object-oriented Programming

Welcome to PGR112! Object-oriented Programming Course Page Canvas page This repository is for students at Campus Bergen taking the course PGR112 this

Høyskolen Kristiania PGR112 Bergen 18 Sep 20, 2022