Question: JAVA The objective of this lab is to write a Java application that uses the topic of inheritance between classes. 1. Create a Person class.

JAVA The objective of this lab is to write a Java application that uses the topic of inheritance between classes. JAVA The objective of this lab is to write a Java application that uses the topic of inheritance between classes. 1. Create a Person class. The class should contain 2 private fields (both Strings called firstName and lastName) and the following methods: - Non-default constructor. - Two getters (accessors) to return the first and the last name - A method named setname to set the fields to the parameters passed - A

1. Create a Person class. The class should contain 2 private fields (both Strings called firstName and lastName) and the following methods: - Non-default constructor. - Two getters (accessors) to return the first and the last name - A method named setname to set the fields to the parameters passed - A method named tostring() 2. The class person should serve as the superclass (base class) for a class called Employee. This subclass should contain 3 fields (paykate, hoursworked, and department). Continue the implementation for class Employee from here and complete the missing code: // This method is to set the fields of Employee to the parameters // passed. public void setall (String first, String last, double rate, double hours, string dep) \{ \} . // This method is to make a copy of an Employee object and return that // copy. public Employee getcopy() \{ \} / end of class Employee 3. Write a simple client for testing. Continue the implementation for class clientemployee from here: SAMPLE OUTPUT: Enter employee last name: Bond Enter employee first name: James Enter department: THEATRE Enter employee pay rate: 35 Enter employee hours worked: 47 The wages for Bond, James from the THEATRE department are: $167.50 Do you want me to make a copy of this employee? (Y or N) Y Completed! The copy has been made

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!