Advertisement
Guest User

Untitled

a guest
Apr 10th, 2021
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. Write an Employee class that keeps data attributes for the following pieces of information:
  2.  
  3. Employee name
  4. Employee number
  5. Next, write class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should add data attributes for the following information:
  6.  
  7. Shift number (an integer, such as 1, or 2)
  8. Hourly pay rate
  9. The workday is divided into two shifts: day and night. The shift attribute will hold an integer representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Write the appropriate accessor and mutator methods for each class.
  10.  
  11. Once you have written the classes, write a program to test the following:
  12.  
  13. First, create two objects:
  14.  
  15. An Employee object:
  16. Name is Mary Johnson, ID is 202
  17. A ProductionWorker object:
  18. Name is Johnson White, ID is 305, Shift is 2, Pay_rate is 30
  19. Print out the Mary’s and Jason’s info. Then,
  20.  
  21. Mary’s name is changed to Mary Smith
  22. Jason’s pay_rate is increased to 32
  23. Print out the updated Mary’s and Jason’s info.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement