Browse Source

upload assignemnts

master
Marcel Haazen 5 years ago
parent
commit
4901abb145
2 changed files with 40 additions and 0 deletions
  1. +29
    -0
      Final Assignment/FA-1.py
  2. +11
    -0
      Les 5/5-3.py

+ 29
- 0
Final Assignment/FA-1.py View File

@ -0,0 +1,29 @@
#!/usr/bin/env python3
#title :FA-1.py
#description :Final Assignemt: NS Functies
#author :Marcel Haazen
#email :marcel@haazen.xyz
#date :23-09-2019 - 11:53
#version :0.1
#usage :python3 FA-1.py
#notes :
#python_version :3.7.4
#==============================================================================
def standaardtarief(afstandKM):
price = 0.0
if afstandKM <0:
# If distance is negative or 0 the price is also 0
return 0.0
elif afstandKM > 50:
# As of 50 KM the price per KM gets decreased to 60 cents bet gets a base price of 15 euro on top
price = round(15.0 + (afstandKM * 0.6), 2)
return price
else:
# Calculate price per KM based on 80 cents per KM and no base price
price = round(afstandKM * 0.8, 2)
return price
ritprijs
print(standaardtarief(25))

+ 11
- 0
Les 5/5-3.py View File

@ -0,0 +1,11 @@
#!/usr/bin/env python3
#title :5-3.py
#description :Opdracht 5.3 - Functie met drie parameters
#author :Marcel Haazen
#email :marcel@haazen.xyz
#date :21-09-2019 - 23:54
#version :0.1
#usage :python3 5-3.py
#notes :
#python_version :3.7.4
#==============================================================================

Loading…
Cancel
Save