A calculator for vehicle toll fees.
Our city has decided to implement toll fees in order to reduce traffic congestion during rush hours.
This is the current draft of requirements:
- Fees will differ between 9 SEK and 22 SEK, depending on the time of day.
- The maximum fee for one day is 60 SEK.
- Only the highest fee should be charged for multiple passages within a 60 minute period.
- Some vehicle types are fee-free.
- Fee-free days are; Saturdays, Sundays, holidays and day before holidays and the whole month of July. See Transportstyrelsen for details.
The last city-developer quit recently, claiming that this solution is production-ready. You are now the new developer for our city - congratulations!
Your job is to deliver the code and from now on, you are the responsible go-to-person for this solution. This is a solution you will have to put your name on.
- Choose one of language alternatives available.
- Modify and re-factor the code as you see fit.
- Deliver your solution by e-mail or another suitable way.
No worries! We accept submissions in other languages as well, why not try it in Go or Kotlin?