Animal | Computer Science homework help

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.

Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We ensure that all instructions are followed meticulously to deliver exactly what you need. You can select your academic level— high school, college/university, or professional— and we will match you with a writer who holds the relevant degree for your task.

Professional and Experienced Academic Writers

Our team of professional writers brings extensive experience in both academic and business writing. Many of our writers are native speakers, ensuring high-quality work for any task you need assistance with.

Free Unlimited Revisions

If you feel something is missing, don’t worry—send your order for a free revision! You have 10 days to request a review after receiving your final document. Simply log into your personal account or contact our support team to initiate the revision process. We’re committed to ensuring your complete satisfaction!

Prompt Delivery and 100% Money-Back-Guarantee

We are committed to delivering all papers on time. Should we require additional time to ensure your paper meets the highest standards, we will reach out to discuss a deadline extension. If an extension is not possible, we offer a 100% refund guarantee to ensure your satisfaction.

Original & Confidential

We utilize advanced writing tools to ensure that every document you receive is free from plagiarism and AI-generated content. Our expert editors meticulously review all citations and references within the text for accuracy. Additionally, we guarantee the highest level of confidentiality with all of our services, ensuring your privacy is always protected.

24/7 Customer Support

Our support agents are available 24/7, dedicated to providing you with the best customer experience. Feel free to reach out anytime you need assistance—we’re here to help!

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Choose peace of mind. Choose Superior Custom Writers—your trusted partner for stress-free academic success!

Essays

Essay Writing Service

No matter the type of academic paper you need or how urgent the deadline, we’ve got you covered! Choose your academic level and paper type, all at an affordable price. Our dedicated team handles all your paper needs while providing round-the-clock, 24/7 customer support for a seamless experience.

Admissions

Admission Essays Help

An admission essay is a critical component of your application, serving as a personal statement highlighting your unique qualities and aspirations for college, university, or graduate school. Our professional writing service,crafts an exceptional, compelling, and tailored admission essay that showcases your strengths and leaves a lasting impression. Let us help you stand out and secure your spot at your dream institution!

Reviews

Editing Support

Our team of expert academic writers and editors ensures your paper is thoroughly polished. We meticulously revise and refine your work, ensuring clarity and coherence. Additionally, we format your document according to your preferred style, including accurate citations and reference lists in APA, Harvard, MLA, Chicago, or Turabian formats.

Reviews

Revision Support

If you feel your paper could be improved, simply request a review. We will have the writer or an editor review your paper to ensure it meets your expectations. You can use this option as many times as needed, at no additional cost, because your satisfaction is our priority. We’re committed to delivering the best possible service, every time.