From 06454f45ed93fe690acdde230682b19d788f08af Mon Sep 17 00:00:00 2001 From: medojanos Date: Tue, 10 Dec 2024 12:00:01 +0100 Subject: [PATCH] Upload project --- .idea/.gitignore | 3 +++ .../inspectionProfiles/profiles_settings.xml | 6 +++++ .idea/misc.xml | 7 +++++ .idea/modules.xml | 8 ++++++ .idea/osztondij_kalkulator.iml | 10 +++++++ .idea/vcs.xml | 6 +++++ osztondij_kalkulator.py | 27 +++++++++++++++++++ test_osztondij_kalkulator.py | 18 +++++++++++++ 8 files changed, 85 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/osztondij_kalkulator.iml create mode 100644 .idea/vcs.xml create mode 100644 osztondij_kalkulator.py create mode 100644 test_osztondij_kalkulator.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5845439 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..bd2573b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/osztondij_kalkulator.iml b/.idea/osztondij_kalkulator.iml new file mode 100644 index 0000000..2c80e12 --- /dev/null +++ b/.idea/osztondij_kalkulator.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/osztondij_kalkulator.py b/osztondij_kalkulator.py new file mode 100644 index 0000000..e750958 --- /dev/null +++ b/osztondij_kalkulator.py @@ -0,0 +1,27 @@ +def osztondijErtek(evismetlo, igazolatlanOrak, evfolyam, atlag): + alap = 100000 + if (evismetlo == "N" and igazolatlanOrak < 6): + if (evfolyam == 9 or evfolyam == 10): + return alap * 0.08 + elif (evfolyam == 11 or evfolyam == 12 or evfolyam == 13): + if (atlag >= 2.00 and atlag <= 2.99): + return alap * 0.08 + elif (atlag >= 3.00 and atlag <= 3.99): + return alap * 0.25 + elif (atlag >= 4.00 and atlag <= 4.49): + return alap * 0.42 + elif (atlag >= 4.5): + return alap * 0.59 + else: + return 0 + else: + return 0 + +if __name__ == "__main__": + print("Kérem adja meg a diák") + evismetlo = input("Évismétlő-e? (I/N): ") + igazaloatlanOrak = int(input("Igazolatlan órák számát: ")) + evfolyam = int(input("Évfolyamát: ")) + atlag = float(input("Átlagát: ")) + osztondij = osztondijErtek(evismetlo, igazaloatlanOrak, evfolyam, atlag) + print(int(osztondij),"Ft") \ No newline at end of file diff --git a/test_osztondij_kalkulator.py b/test_osztondij_kalkulator.py new file mode 100644 index 0000000..d64b443 --- /dev/null +++ b/test_osztondij_kalkulator.py @@ -0,0 +1,18 @@ +from unittest import TestCase +from osztondij_kalkulator import osztondijErtek + +class Test(TestCase): + def test_osztondij0(self): + self.assertEqual(osztondijErtek("I", 3, 12, 4.2), 0) + self.assertEqual(osztondijErtek("N", 7, 10, 3.67), 0) + self.assertEqual(osztondijErtek("N", 0, 11, 1.9), 0) + def test_osztondij8000(self): + self.assertEqual(osztondijErtek("N", 1, 9, 4.2), 8000) + self.assertEqual(osztondijErtek("N", 0, 10, 2.5), 8000) + self.assertEqual(osztondijErtek("N", 0, 11, 2.07), 8000) + def test_osztondij25000(self): + self.assertEqual(osztondijErtek("N", 0, 13, 3.21), 25000) + def test_osztondij42000(self): + self.assertEqual(osztondijErtek("N", 0, 13, 4.00), 42000) + def test_osztondij59000(self): + self.assertEqual(osztondijErtek("N", 0, 12, 4.72), 59000)