Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math as m
- X=2500
- #Aufgabe 1, b)
- def tax(incomePerMonth):
- incomePerYear=(12*incomePerMonth)
- if incomePerYear>53666:
- taxPay=(0.42*incomePerYear)
- elif incomePerYear>53666:
- taxPay=(0.24*incomePerYear)
- elif incomePerYear>8820:
- taxPay=(0.14*incomePerYear)
- else:
- taxPay=0
- return(taxPay)
- #Aufgabe 1, c)
- #erster Input is das monatliche einkommen, zweiter input(optional) das zu versteuernde startkapital(das is doch mit"die Finanzen des betreffenden Einwohners" gemeint?)
- def taxAdvanced(incomePerMonth,initialMoney=0):
- incomePerYear=(12*incomePerMonth)
- if incomePerYear>53666:
- taxPay=(0.42*(incomePerYear+initialMoney))
- elif incomePerYear>53666:
- taxPay=(0.24*(incomePerYear+initialMoney))
- elif incomePerYear>8820:
- taxPay=(0.14*(incomePerYear+initialMoney))
- else:
- taxPay=0
- #output ist das verbleibende geld wenn der Einkommenssteuersatz auf das gesamte kapital angewandt wird. Ich hab echt keine Ahnung wie die Aufgabe gemeint ist.
- return(initialMoney-taxPay)
- #Aufgabe 1, a)
- print("Aufgabe 1, a)")
- while X<=4000:
- print("Citizen with income {}€ has to pay {}€ in taxes".format(X,m.floor(tax(X))))
- X=(X+100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement