Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment we will be making use of inheritance to keep from having to redefine many of the common attributes associated with different types

For this assignment we will be making use of inheritance to keep from having to redefine many of the common attributes associated with different types of containers. You will be defining a general Container class that will have the common attributes of all types of containers and then you need to define three different types of containers (there are many types of containers, however, some examples may be boxes, bottles, drawers, etc). Be creative when coming up with what types of containers you want to define more specifically. At a minimum, you should define the material the container is made of, the color of it, whether it is filled or not, what it is filled with, how much of that it is filled, and a toString method to create a String version of your object for printing. Additional attributes are encouraged. For a 10 point bonus, define a subclass of one of your subclasses to be an even more specialized version of it. Requirements: ? A general Container class that your other classes will inherit from. ? Three different more specific containers that will define their own, more specialized, attributes. ? A toString method to make printing your objects more consistent across all your classes. Be sure to make use of method overriding in your subclasses. ? For the bonus, make sure that there is a recognizable additional specification created

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 Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions