Multiple Objects
Write a program that will input the names, ages and weights of three siblings and display the lightest followed by the youngest of the siblings.
Do the above assignment without using an array of objects.
Create a project asSibling.
In the above project, create a class Sibling not containing the main method.
In the above project, create a class TestSibling containing the main method.
Create a class Sibling. In the class, provide private instance variables for name, age and weight. Provide a constructor with parameters for initializing name, age and weight. Also provide accessor methods getName, getAge and getWeight for getting name, age and weight respectively.
Create a class TestSibling containing the main method. In the main method, input the name, age and weight of each sibling and create a corresponding Sibling object containing the data.
After all Sibling objects are created, the main method will display the data for the lightest sibling followed by the youngest sibling. The data will include the sibling name, age and weight of the sibling. Use the object accessor methods for getting object data.
For doing this assignment, you need to provide only accessor (getter) methods. You don't need to provide modifier (setter) methods.
Input
For testing, use the following input data
Jack 21 130
Judy 24 118
John 26 145
Note that in the above data Jack is 21 years old and weighs 130 lbs.
Output
The program output will appear as below:
The Lightest Sibling: Judy 24 118
The Youngest Sibling: Jack 21 130