Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9.14 cant compile keep getting class interface or enum expected s BUL he first state- (USInS hod's Body) Explain why you would use super in

9.14 cant compile keep getting class interface or enum expected image text in transcribed
s BUL he first state- (USInS hod's Body) Explain why you would use super in the body constru ubclass constructor Explain Uising super in am Instance get Methods in a ent of a of a subclass's instance method 9.13 (Calling get Method d Class's Body) In Figs. 9.10-9.11 methods earnings and to- methods within the same class. Explain the benefits of call Body ach call various get ing these get methods within the classes. urchy) In this chapter, you studied an inheritance hierarchy in wh 4 (Employee usomissionEmployee inherited from class CommissionEmployee. However, not al moloyes are CommissionEmployees. In this exercise, you'll create a more employes are BasePlusCommissi ionEmployees. In this exercise, you ll create a more general Employee superclass he attributes and behaviors in class CommissionEmployee that are common to all En- rtors out t The common attributes and behaviorsEmployees are firstName, lastName totring. Create a new superclass Employee that contains these instance variables and meth that r, getFirstName, getLastName, getSocialSecurityNumber and a portion of socialSecurityNumber nchod ds and a constructor. Next, rewrite class C ommi ss i onEmployee from Section 9.4.5 as a subclass of Em ployee Class CommissionEmployee should contain only the instance variables and methods that are nor decdared in superclass Employee. Class CommissionEmployee's constructor should invoke class Em ployees constructor, and CommissionEmployee's toString method should invoke Employee's to- String method. Once you've completed these modifications, run the CommissionEmployeeTest and asePlusComissionmp loyeeTest apps using these new classes to ensure that the apps still display the ne rouls for a CommissionEmployee object and BasePlusCommissionEmployee object, respectively. Creaing a New Subclass of Employee) Other types of Employees might include Salaried- ses who get paid a fixed weekly salary, PieceWorkers who get paid by the number of pieces prod bout or HourlyEmployees who get paid an hourly wage with time-and-a-half-1.5 times the wage-for hours worked otar 0

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 Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions