Assume the following classes defined below are given: b) c) d) e) public class Person ( 1 } Answer all questions below:

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Assume the following classes defined below are given: b) c) d) e) public class Person ( 1 } Answer all questions below:

Post by answerhappygod »

Assume The Following Classes Defined Below Are Given B C D E Public Class Person 1 Answer All Questions Below 1
Assume The Following Classes Defined Below Are Given B C D E Public Class Person 1 Answer All Questions Below 1 (63.4 KiB) Viewed 15 times
Assume the following classes defined below are given: b) c) d) e) public class Person ( 1 } Answer all questions below: private String lastName; private String firstName; //rest of codes public class Staff extends Person [ private double hourlyWage; private boolean jobStatus; private int yearsEmployed; //rest of codes. Write TWO (2) complete overloading constructors for each class which takes parameters for the attributes defined in above. Write the accessor methods for the class based on the following: 1. a method that returns the full name of the employee (first name and last name) method that returns the employee's employment type as either full-time or part- H. (7 marks) time. Write a method named calcsalary() that calculates and returns the weekly salary assuming one worker would work eight hours a day, five days a week. A tax of 2% should be deducted from the weekly salary. Suppose that 250 employees' data have been stored in the array below: Staff staffData = new Staff [250]; (2 marks) Write a code segment that will output the full name of each employee who's working more than 10 years and getting more than RM8,000.00 per month. Assuming one month has four weeks. (4 marks) Every staff is assigned to at least ONE (1) department. A department has department Name (String), roomNo (String) and phoneExtension (int) as its belonging. Write a statement that shows each staff is assigned to one department. (2 marks) Draw the UML diagram for all THREE (3) classes in above. You only need to show the class name. You do not need to show the attributes and methods. (5 marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply