Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a Superclass University Employee: a. With three attributes to store: 1) baseSalary 2) department 3) yearsWorking b. toString() method which retums a String

image text in transcribed
1. Create a Superclass University Employee: a. With three attributes to store: 1) baseSalary 2) department 3) yearsWorking b. toString() method which retums a String that indicates the baseSalary, department and the number of years the employee has been working in the university c. Abstract method compute Salary(). d. Abstract method information(). 2. Extend a Professor class from the UniversityEmployee class: a. With one attribute: numOfCourses delivered by the professor. b. Override toString() method of the University Employee class, and return the number of courses delivered by that professor. c. Override computeSalary(): [base Salary+ (yearsWorking 2000] + numOfCourses 1000 d. Override information(): method to print that "I am a professor in .... department and I have been working for... years. I teach ... courses. My base salary is $... and my final salary is $..." 3. Extend a Staff class from the UniversityEmployee class a. With two attribute: bonus and typeOfContract (i.e. full time or part time). b. Override toString() method of the University Employee class, and return the bonus earned by the staff member and type of contract. c. Override compute Salary(): [base Salary + (years Working *1500)] + bonus d. Override information(): method to print that "I am a staff member in department and I have been working for... years and I have worked on a contract. My base salary is $... and my final salary is $.... I have earned $. bonus." 4. Create a Driver class that: a. Create an array of four university employees, Create two professors and store it in the array, Create two staff members and store it in the array b. Iterate over the array and print the intro message of the university employees by calling the information() methods. c. Iterate over the array and print the total salaries of all the professors and the total salaries of all the staff members. as You may use input Professor prof1=new Professor( 120000,"Computer Science', 12, 4); Staff staff1=new Staff(90000, "Education", 7. 6000,"full time")

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

46. GivenMX(t).2.3et.5e3t, ndp(x), E(X), V(X).

Answered: 1 week ago

Question

5. What decision-making model would you advocate to this person?

Answered: 1 week ago