This is a tool for calculating the total that the company has to pay an employee, based on the hours they worked and the times during which they worked.
- Input: the name of an employee and the schedule they worked, indicating the time and hours. This should be a .txt file with at least five sets of data. You can include the data from our two examples below.
- Output: indicate how much the employee has to be paid
The following abbreviations will be used for entering data:
MO: Monday
TU: Tuesday
WE: Wednesday
TH: Thursday
FR: Friday
SA: Saturday
SU: Sunday
For example:
Case 1:
INPUT
RENE=MO10:00-12:00,TU10:00-12:00,TH01:00-03:00,SA14:00-18:00,SU20:00-21:00
OUTPUT:
The amount to pay RENE is: 215 USD
Case 2:
INPUT
ASTRID=MO10:00-12:00,TH12:00-14:00,SU20:00-21:00
OUTPUT:
The amount to pay ASTRID is: 85 USD
-
Install
Python
. -
Clone this repository:
git clone https://github.com/evernaschi/payment_calculator.git
-
Set the input file (input.txt) according to the input format
-
Run the program:
python main.py
-
You will see the output with the calculated payment printed in the terminal
If you want to try the testing tools for this program follow these steps: