Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python In this exercise we will put together extended Employee class exercise and the file handling exercise to make complete PayrollSystem with file handling. Remember

python

In this exercise we will put together extended Employee class exercise and the file handling exercise to make complete PayrollSystem with file handling. Remember that names and salaries are asked from user with option 1, but must be handled also from csv-file with option 3, so you have to indentify salarytype. Duplicate employees are not allowed. Create action menu as below:

(1) Add employee to employees

(2) Write employees to file

(3) Read employees from file

(4) Print payroll

(0) Quit

Please enter salary type:

(1) monthly

(2) hourly

(3) commission

(0) Quit

Example output:

(1) Add employee to employees

(2) Write employees to file

(3) Read employees from file

(4) Print payroll

(0) Quit

Please select one: 1

Please enter salary type:

(1) monthly

(2) hourly

(3) commission

(0) Quit

1

Please enter employee name:Jane Doe

Please enter monthly salary:5555

Please enter salary type:

(1) monthly

(2) hourly

(3) commission

(0) Quit

2

Please enter employee name:John Johnson

Please enter hours worked:45

Please enter hour rate:60

Please enter salary type:

(1) monthly

(2) hourly

(3) commission

(0) Quit

3

Please enter employee name:Richard Roe

Please enter monthly salary:2500

Please enter commission:777

Please enter salary type:

(1) monthly

(2) hourly

(3) commission

(0) Quit

0

(1) Add employee to employees

(2) Write employees to file (

3) Read employees from file

(4) Print payroll

(0) Quit

Please select one: 4

Employee Payroll

================

Payroll for: 1 - Jane Doe

- Check amount: 5555

Employee Payroll

================

Payroll for: 2 - John Johnson

- Check amount: 2700

Employee Payroll

================

Payroll for: 3 - Richard Roe

- Check amount: 3277

(1) Add employee to employees

(2) Write employees to file

(3) Read employees from file

(4) Print payroll

(0) Quit

Please select one: 2

3 employee(s) added to employee.csv

(1) Add employee to employees

(2) Write employees to file

(3) Read employees from file

(4) Print payroll

(0) Quit

Please select one: 3

3 employee(s) read from employee.csv

(1) Add employee to employees

(2) Write employees to file

(3) Read employees from file

(4) Print payroll

(0) Quit

Please select one: 1

Please enter salary type:

(1) monthly

(2) hourly

(3) commission

(0) Quit

2

Please enter employee name:Mark Moe

Please enter hours worked:15

Please enter hour rate:30

Please enter salary type:

(1) monthly

(2) hourly

(3) commission

(0) Quit

0

(1) Add employee to employees

(2) Write employees to file

(3) Read employees from file

(4) Print payroll

(0) Quit

Please select one: 4

Employee Payroll

================

Payroll for: 1 - Jane Doe

- Check amount: 5555

Employee Payroll

================

Payroll for: 2 - John Johnson

- Check amount: 2700

Employee Payroll

================

Payroll for: 3 - Richard Roe

- Check amount: 3277

Employee Payroll

================

Payroll for: 4 - Mark Moe

- Check amount: 450

(1) Add employee to employees (

2) Write employees to file

(3) Read employees from file

(4) Print payroll (

0) Quit

Please select one: 0

Service shutting down, thank you.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions