Upload project

This commit is contained in:
medojanos 2024-12-10 12:00:01 +01:00
commit 06454f45ed
8 changed files with 85 additions and 0 deletions

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.12" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (osztondij_kalkulator)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/osztondij_kalkulator.iml" filepath="$PROJECT_DIR$/.idea/osztondij_kalkulator.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

27
osztondij_kalkulator.py Normal file
View File

@ -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")

View File

@ -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)