#Lisa spart. 20% ihres Gesparten wird investiert, 35% spart sie fuers Reisen, 5% legt sie bar in ein Sparschwein und die restlichen 40% gibt sie auf ihr Konto. #Lisas Einnahmen variieren monatlich. Sie will wissen wieviel sie nach 12 Monaten gespart hat. Einnahmen = 0 #Einnahmen zu Beginn sind 0 Euro EinnahmenGesamt = 0 Investition = 0 InvestitionVar = 0.2 #Variable fuer 20 % InvestitionGesamt = 0 Reisen = 0 ReisenVar = 0.35 ReisenGesamt = 0 Sparschwein = 0 SparschweinVar = 0.05 SparschweinGesamt = 0 Konto = 0 KontoVar = 0.4 KontoGesamt = 0 Monat = ["Januar", "Februar", "Maerz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"] MonatAktuell = 0 #Januar---------------------------------------------------------- Einnahmen = 300 #Einnahmen von Lisa fuer Januar EinnahmenGesamt = EinnahmenGesamt + Einnahmen #0 + 300 Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #Februar---------------------------------------------------------- Einnahmen = 170 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #Maerz---------------------------------------------------------- Einnahmen = 220 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #April---------------------------------------------------------- Einnahmen = 360 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #Mai---------------------------------------------------------- Einnahmen = 90 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #Juni---------------------------------------------------------- Einnahmen = 160 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #Juli---------------------------------------------------------- Einnahmen = 310 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #August---------------------------------------------------------- Einnahmen = 295 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #September---------------------------------------------------------- Einnahmen = 280 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #Oktober---------------------------------------------------------- Einnahmen = 40 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #November---------------------------------------------------------- Einnahmen = 230 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, "Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #Dezember---------------------------------------------------------- Einnahmen = 510 EinnahmenGesamt = EinnahmenGesamt + Einnahmen Investition = Einnahmen * InvestitionVar InvestitionGesamt = InvestitionGesamt + Investition Reisen = Einnahmen * ReisenVar ReisenGesamt = ReisenGesamt + Reisen Sparschwein = Einnahmen * SparschweinVar SparschweinGesamt = SparschweinGesamt + Sparschwein Konto = Einnahmen * KontoVar KontoGesamt = KontoGesamt + Konto print Monat[MonatAktuell], " Einnahmen: ", Einnahmen, "Euro (Investition = ", Investition, " Euro, Reisen = ", Reisen, " Euro, Sparschwein = ", Sparschwein, " Euro, Konto = ", Konto, " Euro)" print "Gesamt = ", EinnahmenGesamt print " Investition = ", InvestitionGesamt, " Euro" print " Reisen = ", ReisenGesamt, " Euro" print " Sparschwein = ", SparschweinGesamt, " Euro" print " Konto = ", KontoGesamt, " Euro" print " " print "--------------------------------------------------------------------------------------------------------------------------------" MonatAktuell = MonatAktuell + 1 #----------------------------------------------------------------- print "In dem Jahr hat Lisa insgesamt ", EinnahmenGesamt, " Euro verdient, wovon sie ", InvestitionGesamt, " Euro investiert hat, ", ReisenGesamt, "Euro fuers Reisen ausgegeben hat, ", SparschweinGesamt, " Euro in ihrem Sparschwein hat und ", KontoGesamt, " Euro auf ihrem Konto geblieben sind." #Beispielausgabe ''' Januar Einnahmen: 100 Euro (Investition = 20 Euro, Reisen = 35 Euro, Sparschwein = 5 Euro, Konto = 40 Euro) Gesamt = 250 Euro Investition = 220 Euro Reisen = 135 Euro Sparschwein = 45 Euro Konto = 140 Euro '''