Question: This project promotes the following Student Learning Outcomes: Identify objects associated with a stated problem, then design, code, and test a set of classes for

 This project promotes the following Student Learning Outcomes: Identify objects associated
with a stated problem, then design, code, and test a set of
classes for their representation that demonstrates encapsulation, data abstraction, and information hiding.

This project promotes the following Student Learning Outcomes: Identify objects associated with a stated problem, then design, code, and test a set of classes for their representation that demonstrates encapsulation, data abstraction, and information hiding. 2. 3, 4. 5, Organize programs based on separate declaration, definition, and usage files that demonstrate security considerations. Develop applications based on code designed for reuse and extensibility using best practice software engineering techniques. Formulate programming solutions that use inheritance, polymorphism and class hierarchies to promote reuse of program design and code. Identify objects associated with a stated problem, then design, code, and test a set of classes for their representation that demonstrates encapsulation, data abstraction, and information hiding using simple ADTs Problem Statement A company pays its workers on a weekly basis. The workers are of 3 types: 2. 3. FixedWeekly workers are paid a fixed salary regardless of the number of hours worked ByTheHour workers are paid by the hour and receive overtime pay for all hours worked in excess of 40 PercentofSales workers are paid a percentage of their sales Create a class called Worker. This class will represent the general concept of a worker. All 4 types of workers are considered Workers. The Worker class will be Comparable. Comparable is an interface in the Java API. You will base your comparison on their first name concatenated onto their last names. The Worker class will also be Payable. You will need to create the Payable interface. It will contain just one method called eamings( A Worker has a first name, last name, and social security number. A FisedWeekly worker has a first name, last name, social security number and fixed weekly salary. A By TheHour worker has a first name, last name, social security number, an hourly wage, and number of hours worked A PercentofSales worker has a first name, last name, social security number, gross sales amount, and commission rate The Worker class will contain an appropriate 3 parameter constructor and a default constructor, appropriate accessors and mutators, toString, equals, and compare To methods. It will also contain an earnings method which must be implemented by the subclasses.The constructor will validate that the social security number is in the proper format (999-99-9999) If not in the proper format, the constructor will assign XXX-XX-XXXX for the social security number The FixedWeekly class will contain an appropriate 4 parameter constructor and a default constructor, appropriate accessors and mutators, earnings, toString, equals, and compare To methods. The constructor will validate that the fixed weekly salary is not negative. If the salary figure is negative the fixed weekly salary value will be set to 0. The ByTheHour class will contain an appropriate 5 parameter constructor and a default constructor appropriate accessors and mutators, earnings, toString, equals, and compare To methods. The constructor will validate that the hourly wage is not negative and that the hours worked is between 0 and 60 inclusive. If the hourly wage is negative set the hourly wage to 0. If hours worked is not in the proper range, set the hours worked 0 The PercentOfsales class will contain an appropriate 5 parameter constructor and a default constructor, appropriate accessors and mutators, carnings, toString, equals, and compare To methods. The constructor will validate that the gross sales amount is not negative and that the commission rate is a value between 0.0 and 1.0 inclusive. If these conditions are not met then set the appropriate variable values to 0

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!