Skip to content

evernaschi/payment_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment Calculator

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

Setup

  1. Install Python.

  2. Clone this repository:

    git clone https://github.com/evernaschi/payment_calculator.git
    

How to run

  1. Set the input file (input.txt) according to the input format

  2. Run the program:

    python main.py
    
  3. You will see the output with the calculated payment printed in the terminal

Testing:

If you want to try the testing tools for this program follow these steps:

  1. Install Pip.
  2. Install Pytest:
    pip install -U pytest
    
  3. Run the tests in the project directory
    pytest
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages