Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the class hierarchy shown in the figure below. The classes represent various tynes of staff that mieht be emoloved at a narticular comnanv. All

image text in transcribed

image text in transcribed

image text in transcribed

Consider the class hierarchy shown in the figure below. The classes represent various tynes of staff that mieht be emoloved at a narticular comnanv. All the nav () methods re a) Write a dava statement to deciare an array, namea as starrList, or type StaffMember, whose elements can be used to refer to the various type of staff objects. Set the array size to be 4 . (2 marks) b) Suppose that all of the elements in the array have been assigned with the appropriate staff objects. The following for loop is used to display the amount to be paid to all of the staff. Fill in the missing parts with the correct Java codes. ( 3 marks) c) Suppose that the first element in the array is assigned with an Executi ve object. The following statement is used to award a bonus of RMS00.00 to the staff but it produces a syntax error: staf fist [0]. awardBonus (500.00); Briefly explain the reason for the error. (2 marks) d) Rewrite the Java statement in (c) above which can resolve the syntax error. (2 marks)

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

Step: 3

blur-text-image

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

2 What are the implications for logistics strategy?

Answered: 1 week ago