Question: What Will You Learn Using inheritance to reuse classes. Deliverables person.java student.java studentAthlete.java app.java Students should apply consistent indenting in all submissions. This can be

What Will You Learn

Using inheritance to reuse classes.

Deliverables

person.java

student.java

studentAthlete.java

app.java

Students should apply consistent indenting in all submissions. This can be done via the NetBeans Source menu.

Contents

Using inheritance and the classes (below)

The person class has

first name

last name

age

hometown

a method called getInfo() that returns all attributes from person as a String

The student class is a person with

an id and

a major and

a GPA

student has to call super passing the parameters for the super class constructor

a method called getInfo() that returns all attributes from student as a String

this methods has to override the method getInfo() in person

The student-athlete class is a student with

a sports (football, or track, or soccer, volleyball, etc.)and

a ranking (a random number between 0 and 100)

student-athlete has to call super passing the parameters for the super class constructor

a method called getInfo() that returns all attributes from student-athlete as a String

this methods has to override the method getInfo() in student

Create an application (app) that:

Creates one student-athlete object.

Displays all information about the student-athlete object

Does it in the most efficient way possible (avoids unnecessary duplication of attributes and methods)

Uses the classes

app

person

student inheriting from person

student-athlete inheriting from student

person First name Last name Age Hometown getlnfo() app Creates 1 student-athlete object 1-Displays the complete information about the student-athlete object student New attributes in addition to person's attributes Ild I Major GPA Overrides the method from the superclass person 1 getlnfol New attributes student's attributes Student-athlete in addition to sports ranking. Overrides the method from the i superclass student getinfol)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!