Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA PROGRAMMING using VSCODE Goal: To use OO techniques (including inheritance) to represent complex class relationships describing different types of people and containers at a

JAVA PROGRAMMING using VSCODE

Goal:

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

Deliverables:

  • Your Java code files (as described below).
  • A screen capture of your UML Class diagram.

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

Requirements:

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

---------

Step 2: Add a Container class. It should be an abstract class. Your Container class must be properly encapsulated and include the following attributes:

  • brand
  • height
  • color

In addition to a constructor that allows you to set all of these values, it should include a getInfo() method and an abstract calculateVolume() method.

---------

Step 3: Add a CircularContainer class. Your CircularContainer must be a subclass of your Container class. In addition to the attributes that it inherits from Container, CircularContainer should add the following attributes:

  • radius

It should include a getInfo() method and a calculateVolume() method that override the versions of these methods from your parent class. You may use the following formula for volume:

volume=radius2height

---------

Step 4: Add a RectangularContainer class to your project. Your RectangularContainer must be a subclass of your Container class. In addition to the attributes that it inherits from Container, RectangularContainer should add the following attributes:

  • width
  • length

It should include a getInfo() method and a calculateVolume() method that override the versions of these methods from your parent class. You may use the following formula for volume:

volume=lengthwidthheight

---------

Step 5: Add a ContainerParty class. 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 in child classes must use the super keyword to leverage the getInfo() method of its parent class. Remember DRY - Dont 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 a UML Class Diagram for your ContainerParty, Container, and Person classes. 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 an image of your diagram. No credit will be given for VISIO files or URLs to websites.

---------

Step 8:In your main method, create 2 instances of your ContainerParty class. 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 your ContainerParty class to display all information about each party.

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions