Question: Write a java code 1. Defne a class named Employee whose objects are records for employees. Derive this class from the class Person given in

Write a java code  Write a java code 1. Defne a class named Employee whose

1. Defne a class named Employee whose objects are records for employees. Derive this class from the class Person given in Lesson. An employee record inherits an employee's name from the class Person. In addition, an employee record contains an annual salary represented as a single value of type double, a hire date that gives the year hired as a single value of type int, and an identification number that is a value of type String. Give your class a reasonable complement of constructors, accessor methods, and mutator methods. Write a program to fully test your class definition. 2. Define a class named Doctor whose objects are records for a clinic's doctors. Derive this class from the class Person given in Lesson. A Doctor record has the doctor's name-defined in the class Person-a specialty as a string (for example Pediatrician, Obstetrician, General Practitioner, and so on), and an office-visit fee (use the type double). Give your class a reasonable complement of constructors and accessor methods, Write a driver program to test all your methods. 3. Create a base class called Vehicle that has the manufacturer's name (type String), number of cylinders in the engine (type int), and owner (type Person given in Lesson). Then create a class called Truck that is derived from Vehicle and has additional properties: the load capacity in tons (type double, since it may contain a fractional part) and towing capacity in tons (type double). Give your classes a reasonable complement of constructors and accessor methods. Write a driver program that tests all your methods

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!