This project involves creating Python and R scripts to facilitate the weekly payments of workers at Highridge Construction Company. The tasks include dynamically generating a list of workers, processing payment slips with conditional logic, and including error handling.
The Python script performs the following tasks:
- Dynamically creates a list of 400 workers with random salaries and genders.
- Generates payment slips for each worker.
- Implements conditional logic to assign employee levels based on salary and gender.
- Includes exception handling to manage potential errors.
- Python 3.x
pandas
library
-
Install the required Python package:
-
Save the following code in a file named
worker_payment.py
:
-
Run the Python script:
python worker_payment.py
-
Verify output:
- The script will generate a CSV file and zip it with the employee profile.
- Payment slips will be printed to the console.
The R script performs the following tasks:
- Reads the worker data from a CSV file.
- Processes the data to generate payment slips with employee levels.
- Includes error handling to manage potential issues.
- R
utils
package (included in base R)
- Save the following code in a file named
worker_payment.R
:
-
Run the R script:
Rscript worker_payment.R
-
Verify output:
- The script will print the first few payment slips to the console.
This README provides a comprehensive guide for setting up, running, and verifying the Python and R scripts for the assignment. It ensures users understand how to execute the scripts and what outputs to expect.