Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the sample files attached as your guide, in this project you will create an inheritance structure in Java. You will create a super class

image text in transcribed

Using the sample files attached as your guide, in this project you will create an inheritance structure in Java. You will create a super class called BarnYardAnimal.java. This class will have a String instance variable called name. The class will have a constructor that passes in the name of the animal. The class will also have a displayO method that returns, as a string, the name of animal. You will have two subclasses in this structure that inherit from BarnYardAnimal.java. One called Chicken.java and one called Pig.java. Each class will have a String instance variable called sound. The class will have a constructor that passes in a name and sound. The class will have a display0 method that returns, as a string, the type, name, and sound of the animal Start by building the UML class diagram for these classes showing the inheritance relationship. Then construct the classes Once you have finished the classes, write a test program that creates and displays three objects. Make sure that you are using each constructor specified in some way. For extra credit, you can show polymorphism, but please make sure that you point it out in your code. For extra credit, you can also loop to create and display the objects Grading Rubric Criteria UML Class Diagrams correctly specified Classes appropriately named Inheritance correctly indicated Instance variables correctly created Constructors correctly created Methods correctly created Correctly creates three objects Correctly displays three objects TOTAL Points 15 5 5 15 15 15 15 15 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

Compare and contrast the capabilities of Excel and Access.

Answered: 1 week ago

Question

Determine if y is a function of x. = x+1

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago