Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Class named Baby The first part of the assignment is to create a Super Class named Baby. Create a basic UML Diagram for

Create a Class named Baby

The first part of the assignment is to create a Super Class named Baby. Create a basic UML Diagram for the Class named Baby. After creating the Class Diagram, implement the Class and the methods of your class from the Class Diagram.

Requirements for the Baby Class

An instance of a Baby Class has a name property, a weight property, and the date of the birth property. The class should contain the basic functionality of a user-defined object described in Chapters 8.

Required Functionality in the Baby Class

Set methods for each property

Get methods for each property

Default and initialization Constructors

a toString Method

Additional Utility Functionality for the Baby Class

In addition to the basic functionality that all user-defined objects should have, there are some additional utility functionality specific to this class. The class should have the following additional behaviors/methods

  1. poop method - when invoked, the method should return or print a message indicating the method was invoked successfully.
  2. cry method - when invoked, the method should return or print a message indicating the method was invoked successfully.
  3. crawl method - method should receive a text string indicating the direction crawling

Create a Class named YoungAdult

The next segment of this part of the assignment in this module is to create a basic UML Diagram for a Young Adult class and create the class for the Young Adult Object. First, create the Class Diagram. After creating the Class Diagram, create and implement the Class and the methods of your Youn Adult class from the Class Diagram. The Young Adult class should inherit from the Baby Class.

Requirements for the Young Adult Class

Create a class named Young Adult. An instance of a Young Adult Class has a social security number. The Young Adult class should contain the basic functionality of a user-defined object described in Chapters 8 and 9 of the textbook.

Required Functionality in the Young Adult Class

Set methods for each property

Get methods for each property

Default and initialization Constructors

a toString Method

a equals method

a compareTo method

a copy method

Require Functionality in the Young Adult Class

Set methods for each property

Get methods for each property

Default and initialization Constructors

toString method

equals method

compareTo method

copy method

Additional Utility Functionality for the Young Adult Class

In addition to the basic functionality that all user-defined objects should have, there are some additional utility functionality specific to this class. The class should have the following additional behaviors/methods

  1. walk method - method should receive a text string indicating the direction crawling
  2. talk method - method should receive a text string that returns or prints what an instance of a young is saying

You should:

1. Design and create the class declaration for the Young Adult class according to the annotated UML diagram that you created, and add it to the IntelliJ project in a new Java class file.

2. Modify the executable Main Class containing the main method to test the Young Adult Class, as follows:

a. You should instantiate a Young Adult object. ( such as,

YoungAdult ya1 = new YoungAdult(); ya1 is just an example. You can decide what to name the variable.)

b. You should instantiate a separate Young Adult object using the initialization constructor.

c. print the initial data for the Young Adult Instances using the toString method or a combination of getter methods of the object.

d. Change some values in these instances using the set methods that you created for the object

e. test your get methods by using them in print statements listing the values in the modified properties.

Overall, complete the following tasks

  • Instantiate some instances of your Young Adult Class. Use your initialization constructor to give an instance object of a Young Adult Class an initial state. Use your default constructor to give an instance object of a Young Adult Class an initial state. After giving instances default states, use your set methods to change the state of the objects. Use the (to String) method of Young Adult Class to print out the state of the instances of the Young Adult Class that was created in memory. Create statements that illustrate that your set and get methods are working correctly.

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions