Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago