ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 12 May 2017 My Price 8.00

Create a new “Java Application” project

Create a new “Java Application” project, name it as “InheritanceExample”

In this project, add a new Class call “People”. This class must extends the Object class in java. “People” has following protected attributes: String firstName, String lastName, Date birthday (import java.util.Date), int SSN. To access these 4 protected members, please create 4 public getters and setters for all these protected attributes. For class people, also create two constructors. One constructor take all 4 paramenters, one constructor only takes 2 parameters (firstName, lastName).

In “People” class, create a Display() method. This method will display following information. If this People object has only firstName, lastName, then display “This is firstName lastName”. If this People object has firstName, lastName, birthdate, SSN then display “This is [firstName] [lastName] with SSN#[SSN]”

Add a new subclass call “Student”. This subclass must extends the People superclass in java. “Student” has following protected attributes: String[] courseList, int studentID, int scholarship. For your student subclass, add one new constructor, which will take 3 parameters Student(String firstName, String lastName, int scholarship). Make sure in your constructor, the super constructor of 2 parameters should be called, else you will get compilation error.

Add a new subclass call “Employee”. This subclass must extends the People superclass in java. “Employee” has following protected attributes: int salary, int employeeID. For your Employee subclass, add one new constructor, which will take 6 parameters Employee(String firstName, String lastName, int salary, int employeeID, int SSN, Date birthday). Make sure in your constructor, the super constructor of 4 parameters should be called, else you will get compilation error.

Add a new subclass call “Faculty”. This subclass must extends the Employee superclass in java. “Faculty” has following extra protected attributes: String[] courseList. Faculty must have a constructor that accepts 6 parameters Faculty(String firstName, String lastName, int salary, int employeeID, int SSN, Date birthday).

Add a new subclass call “Staff”. This subclass must extends the Employee superclass in java. “Staff” has following extra protected attributes: String jobDuty. Staff must have a constructor that accepts 6 parameters Staff (String firstName, String lastName, int salary, int employeeID, int SSN, Date birthday).

After you have built a Hierarchy of inherited classes, in you main application, please do following:

Create a new People object, with all 4 parameters

Create a new Student object, with 2 parameters

Create a new Faculty object, with all 6 parameters

Create a new Staff object, with all 6 parameters

Call all previous 4 objects’ Display() function

Answers

(11)
Status NEW Posted 12 May 2017 07:05 AM My Price 8.00

-----------

Attachments

file 1494573041-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)