59 lines
2.0 KiB
Python
59 lines
2.0 KiB
Python
def init():
|
|
print("Hallo und willkommen zum Endnotenberchnungsprogramm!")
|
|
print("Bitte gib an, welches Programm du starten willst:")
|
|
print("1. Endnotenberechnung mit Kursarbeit")
|
|
print("2. Endnotenberechnung ohne Kursarbeit")
|
|
user_input = input()
|
|
if user_input == "1":
|
|
main()
|
|
elif user_input == "2":
|
|
ohne_kursarbeit()
|
|
else:
|
|
print("Bitte nur 1 oder 2 eingeben")
|
|
init()
|
|
def main():
|
|
print("Hallo und willkommen zum Endnotenberchnungsprogramm!")
|
|
print("Bitte gib die Anzahl der normalen Noten ein:")
|
|
normale_noten = input()
|
|
# Make an Array with the these numbers
|
|
normale_noten_array = []
|
|
for i in range(0, int(normale_noten)):
|
|
print("Bitte gib die Note ein:")
|
|
note = int(input())
|
|
normale_noten_array.append(note)
|
|
alle_noten_zusammen = sum(normale_noten_array)
|
|
# Get Avarage of the normal Notes
|
|
avarage_normale_noten = alle_noten_zusammen / int(normale_noten)
|
|
# Multiply avarage of the normal notes with 2/3
|
|
avarage_normale_noten_2_3 = avarage_normale_noten * 2 / 3
|
|
print("Bitte gib die Note der Kursarbeit ein:")
|
|
kursarbeit = int(input())
|
|
kursarbeit_1_3 = kursarbeit * 1 / 3
|
|
endnote = int(kursarbeit_1_3) + int(avarage_normale_noten_2_3)
|
|
print("Deine Endnote ist: " + str(endnote))
|
|
|
|
def ohne_kursarbeit():
|
|
print("Hallo und willkommen zum Endnotenberchnungsprogramm!")
|
|
print("Bitte gib die Anzahl der normalen Noten ein:")
|
|
normale_noten = input()
|
|
# Make an Array with the these numbers
|
|
normale_noten_array = []
|
|
for i in range(0, int(normale_noten)):
|
|
print("Bitte gib die Note ein:")
|
|
note = int(input())
|
|
normale_noten_array.append(note)
|
|
alle_noten_zusammen = sum(normale_noten_array)
|
|
# Get Avarage of the normal Notes
|
|
avarage_normale_noten = alle_noten_zusammen / int(normale_noten)
|
|
|
|
print(avarage_normale_noten)
|
|
|
|
init()
|
|
print("Nochmal rechnen ((J)a/(N)ein)?")
|
|
start = input()
|
|
if start == "J" or start == "ja":
|
|
init()
|
|
else:
|
|
print("Auf Wiedersehen!")
|
|
exit()
|