1. Employee data a) Write a Python class called Employee that maintains some employee data: employee ID, employee name,

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: 899604
Joined: Mon Aug 02, 2021 8:13 am

1. Employee data a) Write a Python class called Employee that maintains some employee data: employee ID, employee name,

Post by answerhappygod »

1 Employee Data A Write A Python Class Called Employee That Maintains Some Employee Data Employee Id Employee Name 1
1 Employee Data A Write A Python Class Called Employee That Maintains Some Employee Data Employee Id Employee Name 1 (58.79 KiB) Viewed 20 times
1. Employee data a) Write a Python class called Employee that maintains some employee data: employee ID, employee name, employee worked hours and employee pay rate. Pay rate values and worked hours are a float number with two decimal points. You need to create accessors methods for employee ID, employee name, employee worked hours and employee pay rate. Do not create any mutators methods for this question. b) Create a method get_total_pay that calculates and returns the total pay of an employee. Total pay worked hours x pay rate. c) Create an_str___method representing an employee data in this format: Name: Thair Dalain, Worked hours: 30, Pay rate: $100, Total pay: $300. d) In your main() function, instantiate the employee class for two different employees with some dummy data and print out those instances using print() calls. 2. Book objects a) Create a Book class that holds these attributes: ISBN, title, author, publish year, book status. Since books can have a different status, the book status should be a list of strings, for example ['Available', 'Reserved', 'Borrowed', 'Damaged']. b) Create accessor methods for all attributes and create a mutator to update the book title. c) Create another program and import the Book class to it. This program creates one or more book objects with any sample data and then prints out those instances using accessor methods.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply