Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toll Calculator in Pyhton. #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AndreasYpper
Copy link

Here is my simple take on the toll calculator.

Used pytest for testing and also added a pip package called holidays to check for all Swedish holiday dates.

Vheicles.py file defines an abstract class Vehicle and then all vehicle types that the toll calculator handles inherit from the vehicle class. Added a class function 'is_vehicle_tollable()' so if in the future more vehicle types should be charged it would be easy to find where to make the changes.

TollCalculator.py does the calculation of the toll fee given a list of dates and a vehicle. The list of dates can span over multiple days and it will still calculate the correct amount.

TollDate.py handles if the date is a tollable date and also the fee ruling.

app.py and input_configs.py is used for running the program and have some sort of real life test input.

_Would love to sit down and discuss my solution and how it could be improved.

mvh,
Andreas Ypper_

Here is my take on the toll calculator!
@AndreasYpper
Copy link
Author

Checked my PR now with rested eyes and saw that I left a print statement in TollCalculator.py on line 53. That should not be there of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant