Expert answer:Simple Java (Inheritance)

Solved by verified expert:FIle name: SiblingExtTopicsInheritanceDiscussionInheritance involves creating a class by extending another class. The extended class is called a child class and the original class is called the parent class. For creating a child class, we need the .class file of the parent class.The child class is created by adding an extends clause in the child class header.Once created, an object of the child class contains all the instance variables and constructors and instance methods of child, parent and parent’s parent (ancestor) classes.The object of the child class is created by using a child class constructor. Java requires that a child class constructor call parent class constructor as its first statement using reserved word super.DescriptionWrite a program that will input the names, ages, weights and heights of three siblings and display the lightest followed by the youngest followed by the tallest of the siblings.This program will be an enhancement of a previous exercise that did the same. However, this program will additionally provide for inputting height and displaying the tallest sibling.Do this assignment using inheritance as described in implementation section below.ImplementationFor this assignment create the following classes.SiblingCreate a class Sibling with private instance variables for name, age and weight. Provide a constructor with parameters for initializing name, age and weight. Also provide accessor methods for getting name, age and weight.The content of this class will be identical to the one in the previous exercise. You may copy the contents of this class from the previous exercise.SiblingExtCreate a class SiblingExt that will extend the class Sibling above and will provide a private instance variable for keeping height. It will provide a constructor with parameters for initializing name, age, weight and height. This constructor will call the parent constructor for initializing name, age and weight and will initialize the height by itself. The class will also provide an accessormethod for getting height. (Since this class extends the Sibling class, the accessor methods from the Sibling class for getting name, age and weight will be part of an object of this class).TestSiblingExtWrite a class TestSiblingExt containing the main method. In the main method, input the name, age, weight and height of each sibling and create a corresponding SiblingExt object containing the data.After all SiblingExt objects are created, the main method will display the data for the lightest sibling followed by the youngest sibling followed by the tallest sibling. The data will include the sibling name, age, weight and height of the sibling. Use the object accessor methods for getting object data.This class can be created by modifying the TestSibling class in the previous exercise. You may copy the contents of TestSiblingclass from a previous exercise and then modify them to create this class.INSTRUCTIONSDo the above assignment without using an array of objects.CLASS NOTESCreating a SiblingExt object String name = “John Doe”; int age = 20; int weight = 150; int height = 70; //Create SiblingExt reference SiblingExt sibe; //Create an object of SiblingExt class sibe = new SiblingExt (name, age, weight,height);Runtime Steps In Creating SiblingExt ObjectLoad the Class SiblingExt (SiblingExt.class file) in memory to use it as a blue print.Load the Class Sibling (Sibling.class file) in memory to use it as a blue print.Load the class Object (Object.class file) in memory to use it as a blue print.Create a part of the object using the blue print Object.Create an additional part of the object using the blue print Sibling.Create the final part of the object using the blue print SiblingExt.Call the SiblingExt constructor of the created object.The SiblingExt constructor will call the Sibling constructor.The Sibling constructor will call the Object constructor.Object creation and initialization is completed. The object will contain instance variables and associated constructors and methods from all three blue prints (Object, Sibling, SiblingExt). Return the reference of the object.Chain Of Constructor CallsJava requires that the first statement in each constructor be a call to the parent constructor using the reserve word super. If the user does not include this call, the compiler adds such a call with no parameters. If such a constructor does not exist in the parent class, the compiler issues an error.The above rule results in the following:A call to a constructor results in a chain of constructor calls.The sequence of constructor calls is from bottom (child) to top (parent).The sequence of constructor call completion is from top (parent) to bottom (child).SAMPLE CODE//Sample code for SiblingExtpublic class SiblingExt extends Sibling{ private int height; public SiblingExt (String n, int a, int w, int h ) { super (n,a,w ); height = h; } public int getHeight ( ) { return height; }}TESTINGInput For testing, use the following input data: Jack 21 130 69Judy 24 118 63John 26 145 70Note that in the above data Jack is 21 year old, weighs 130 lbs and is 69 inches tall.OutputThe program output may appear as below:The Lightest Sibling: Judy 24 118 63The Youngest Sibling: Jack 21 130 69The Tallest Sibling: John 26 145 70SUBMITSubmit the source code and the final output only.

How it works

  1. Paste your instructions in the instructions box. You can also attach an instructions file
  2. Select the writer category, deadline, education level and review the instructions 
  3. Make a payment for the order to be assignment to a writer
  4.  Download the paper after the writer uploads it 

Will the writer plagiarize my essay?

You will get a plagiarism-free paper and you can get an originality report upon request.

Is this service safe?

All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 20% with the discount code ESSAYHELP