Goal: To use OO techniques (including inheritance) to represent complex class relationships modeling various people and types of containers at a Container Party. Deliverables: Your Java code files (as...


Goal:


To use OO techniques (including inheritance) to represent complex class relationships modeling various people and types of containers at a Container Party.


Deliverables:



  • Your Java code files (as described below).

  • Ascreen captureof your UML Class diagram.



-------------------------



Requirements:


Step 1: Create a new Java class namedContainerMadnessAssignment. Add your main method to this class.



---------


Step 2: Add aContainerclass. It should be anabstractclass. Your Container class must beproperly encapsulatedand include the following attributes:



  • brand

  • height

  • color


In addition to aconstructorthat allows you to set all of these values, it should include agetInfo()method and anabstractcalculateVolume() method.



---------


Step 3: Add aCircularContainerclass. YourCircularContainermust be a subclass of yourContainerclass. In addition to the attributes that it inherits fromContainer,CircularContainershould add the following attributes:



  • radius


It should include agetInfo()method and acalculateVolume()method thatoverridethe versions of these methods from your parent class. You may use the following formula for volume:



volume=πradius2⋅height



---------


Step 4: Add aRectangularContainerclass to your project. YourRectangularContainermust be a subclass of yourContainerclass. In addition to the attributes that it inherits fromContainer,RectangularContainershould add the following attributes:



  • width

  • length


It should include agetInfo()method and acalculateVolume()method thatoverridethe versions of these methods from your parent class. You may use the following formula for volume:



volume=lengthwidthheight



---------


Step 5: Add aContainerPartyclass. It should contain:



- The date of the party



- A list of people attending (please use your Person object here)



- A list of containers at the party (please use your Container class here)



- The address of the party (this can be either a String or a Class)


---------



Important:Your getInfo() methods inchildclassesmustuse thesuperkeyword to leverage the getInfo() method of itsparentclass.Remember DRY -Don’t Repeat Yourself! You should not unnecessarily duplicate any code between getInfo() in your subclass and superclass!


---------


Step 6: Create a Person class with 3 attributes of your choice. Add methods, and constructors as necessary to complete the assignment.


---------


Step 7: Create aUML Class Diagramfor yourContainerParty, Container, CircularContainer, RectangularContainer,andPersonclasses. You must follow the 3 box approach used in class, represent "is-a" relationships with vertical lines, "has-a" relationships with horizontal lines, and label your relationships.


You may use any tool you like (including paper and pen!), but you must upload animageof your diagram. No credit will be given for VISIO files or URLs to websites.



---------


Step 8:In your main method, create 2 instances of yourContainerPartyclass. Each party should take place at a different address on a different date. Three different people should attend each party. Each party should have two CircularContainers and two RectangularContainers. You should only use one ArrayList to contain all of the containers at each party.This ArrayList should contain appropriate objects -- not Strings.


There is no need to use Scanner -- you may hard-code these values in your main() method.


Your entity classes should not contain any hard-coded values.


Use the getInfo() method of yourContainerPartyclass to display all information about each party.



---------


You are welcome to use either VSCode or NetBeans to complete this assignment. If you use VSCode, upload your Java files. If you use NetBeans, export your project to a ZIP file and upload that. Please do not upload any compression formats other than ZIP files. Other formats (e.g. 7zip, tar.gz, etc.) will not be accepted and will result in a grade of zero. Remember to also upload a screenshot of your UML diagram.

Oct 08, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here