Please attach the requested programs below as your assignment submission.

Please attach the requested programs below as your assignment submission.

Your assignment is to create a hierarchy of classes representing animals.

The root of the hierarchy should be a class named Animal (in file Animal.java), described in more detail below.

There must be at least two subclasses of Animal (you are welcome to have more than two). If you have no other ideas, you may name the subclasses Pet (Pet.java) and MarineAnimal (MarineAnimal.java), but you are welcome to choose different groups of animals.

Each of your subclasses of Animal must in turn have at least one subclass (it may have more). Each of these sub-sub-classes of Animal must represent a specific animal, such as dog, cat, green turtle, octopus, and so on. In total, you must have at least six of these classes, representing six different kinds of animals. Choose suitable names for each of these animal classes — the TA may award less than full credit if your names are not suitable, so if you choose an unusual animal, make sure an appropriate comment clearly explains why your choice is suitable. It is also your choice which of these animals belongs to which subclass of Animal, but again your score may depend on the appropriateness of your choices and/or on how well your comments explain your choices.

Your Animal class must have at least:

  • An instance variable to represent the animal’s current weight. You can choose the units (grams, kilograms, ounces, pounds, etc). Your code must have a comment saying which units this variable represents.
  • Another instance variable to represent the animal’s weight when fully grown. This variable should use the same units as the previous variable.
  • Another instance variable to represent the animal’s current size. Again, you must both choose and document suitable units.
  • Another instance variable to represent the animal’s size when fully grown. This variable should use the same units as the previous variable.
  • A constructor that takes as parameters the initial values of all four instance variables, and initializes them accordingly.
  • A method eat that eats a certain amount of food, and increases the animal’s weight by 1% of the amount of food (but without ever exceeding the animal’s fully-grown weight), and similarly increases the animal’s size by exactly 1%, again never exceeding the animal’s fully grow size.
  • Accessor methods for each of the animal’s weight and size.

For your immediate subclasses of Animal, you should choose which instance variables (if any) and methods they provide. The same is true for the individual animal classes. The only requirement is that each of these classes must have at least one new instance method not present in any of its superclasses. Again, choose suitable methods. For example, a Pet usually has a name, and a MarineAnimal may or may not breathe air.

As well as its own unique method, each animal or group of animals may override one or more methods from its superclass(es). This is up to you.

You must also create a TestAnimals class with a main method that does all of the following:

  • Create at least two animal objects of each class of each specific animal. Since you are required to create at least six specific animal classes, the test program will have at least twelve animal objects. Animals should be created with a reasonable minimum size and weight.
  • Feed each of the animals at least until it is fully grown. Once the animal is fully grown both in weight and in size, print the animal’s name and how many feedings it took for it to grow to full size and weight.
  • Call at least once each of the methods specific to each of the animal classes.
  • Call at least once each of the methods specific to each of the classes representing groups of animals.

The code in your TestAnimals class need not be all in the main method, and in fact you are encouraged to create and use multiple methods within this class.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Before reviewing the assigned readings, what do you suppose Nursing Assignment Help

Before reviewing the assigned readings, what do you suppose are some differences between anxiety and depression? How do you suppose thoughts and/or behaviors are different between someone experiencing anxiety vs someone experiencing depression? Motivational Interviewing (MI) was originally developed to treat the substance use population, as shown in this week’s

Assessment Description Moral and ethical development in children affects student

Assessment Description Moral and ethical development in children affects student learning and school/classroom interactions. Teachers need to ensure moral and ethical instruction and interactions are taking place in the classroom/school. For this assignment, you will create a 12-15 slide digital presentation on the subject of the moral and ethical development

M​‌‍‍‍‌‍‌‍‍‍‌‌‌‍‌‌‌‌‌‌​y dissertation is a research project that should closely resemble

 M​‌‍‍‍‌‍‌‍‍‍‌‌‌‍‌‌‌‌‌‌​y dissertation is a research project that should closely resemble a literature review reported in a peer-reviewed journal. Its organization should therefore follow the standard format of the articles in these journals. Examples of good review papers can be found in these journals: -Psychological Bulletin -Annual Review of Psychology -Review

Short paper- Bible as Literature

 Description Submit papers electronically via Short Paper assignment in above Format: double spaced with MLA style documentation (Bedford Researcher) 5 – 6 pages (about 1250 -1500 words) plus a Works Cited (even if your do not do additional research — include our class readings if used) a topic of your

The Linguistics of Color Blind Racism

 In “The Linguistics of Color Blind Racism: How to Talk Nasty about Blacks without Sounding ‘Racist.” Sociologist Eduardo Bonilla-Silva identifies five stylistic components of color blind racism. Select one of these styles and use it to examine a racial incident from the last 10 years in which the selected style

Read the article: http://www.nbcnews.com/tech/social-media/cleveland-shooting-highlights-facebook-s-responsibility-policing-depraved-videos-n747306 Discuss whether you believe that Facebook

Read the article: http://www.nbcnews.com/tech/social-media/cleveland-shooting-highlights-facebook-s-responsibility-policing-depraved-videos-n747306 Discuss whether you believe that Facebook has a legal or ethical duty as to what gets posted on its platform. If someone is recorded and viewed getting hurt, is Facebook legally liable to the victim? Why or why not? Research and suggest three ways that social

Read and watch the lecture resources & materials below early

Read and watch the lecture resources & materials below early in the week to help you respond to the discussion questions and to complete your assignment(s). (Note: The citations below are provided for your research convenience. You should always cross-reference the current APA guide for correct styling of citations and

All languages have resources for making new words to encode

  All languages have resources for making new words to encode new meanings. This week you read about morphemes, which are the smallest linguistic units for conveying meaning. In some languages we can use morphemes to create new words. For example, if we decided not to be friends with someone

I want you to write a case report 4-6 pages. about Low Back Pain which is Write, present, publish, and evaluate case reports following the CARE guidelines 1.Title The words ‘case report’ should appea Nursing Assignment Help

I want you to write a case report 4-6 pages. about Low Back Pain which is Write, present, publish, and evaluate case reports following the CARE guidelines  1.Title The words ‘case report’ should appear in the title along with phenomenon of greatest interest (symptom, diagnosis, test, intervention, etc.) 2. Keywords

Select one of these topics to summarize and discuss. These

  Select one of these topics to summarize and discuss. These topics explore clinical standards, disease-specific assessments, and risk assessment tools, as well as evidence-based practice for cardiovascular pathology topics for this section. Support your answer with two or three peer-reviewed resources. Heart Failure Evidence-Based Practice and Treatment Standards for

For this assignment, you will complete the Unit IV Problem

For this assignment, you will complete the Unit IV Problem Solving Assignment worksheet. This assignment will allow you to demonstrate what you have learned in this unit. Instructions for completing this assignment are located on the worksheet. Use the  Unit IV Problem Solving Assignmentworksheet for this assignment. Save all of

Instructions – PLEASE READ THEM CAREFULLY 1. The Assignment must

   Instructions – PLEASE READ THEM CAREFULLY  1. The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. 2. Assignments submitted through email will not be accepted. 3. Students are advised to make their work clear and well presented, marks may be reduced for poor presentation. This

Pick one of the following films: The Departures (viewable on

Pick one of the following films: The Departures (viewable on Youtube for $2.99, Vudu for $2.99, Amazon Prime Video subscription) OR The Immortal Life of Henrietta Lacks (viewable on Hulu, Amazon Prime Video for $2.99, Apple TV for #3.99, HBO Max w/ subscription, or Vudu for $2.99). CONTENT: A reflection

At the top of your assignment, include the honor pledge:

  At the top of your assignment, include the honor pledge: “I pledge on my honor that I have neither given nor received unauthorized assistance on this assignment.” An actor’s method or process of acting is based on his particular training and theatre experiences. There are several “schools” of acting in

Learning Objectives: · Use Knapp’s model to describe the nature

Learning Objectives: ·        Use Knapp’s model to describe the nature of communication in the various stages of a relationship. ·        Identify the three stages of Knapp’s model: coming together, relational maintenance, and coming apart. ·        Reflect on how changes in these three stages of the relationship might have caused the relationship to unfold