From 4901abb145268368db8e48c30185f3cc9e848f13 Mon Sep 17 00:00:00 2001 From: Marcel Haazen Date: Mon, 23 Sep 2019 14:32:20 +0200 Subject: [PATCH] upload assignemnts --- Final Assignment/FA-1.py | 29 +++++++++++++++++++++++++++++ Les 5/5-3.py | 11 +++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Final Assignment/FA-1.py create mode 100644 Les 5/5-3.py diff --git a/Final Assignment/FA-1.py b/Final Assignment/FA-1.py new file mode 100644 index 0000000..d790985 --- /dev/null +++ b/Final Assignment/FA-1.py @@ -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)) diff --git a/Les 5/5-3.py b/Les 5/5-3.py new file mode 100644 index 0000000..2370416 --- /dev/null +++ b/Les 5/5-3.py @@ -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 +#==============================================================================