-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
42 lines (35 loc) · 1.08 KB
/
index.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from modules.getMarks import getMarks
from modules.presencePercentage import presencePercentage
from modules.percentageCount import percentageCount
from modules.result import result
from modules.printRow import printRow
from modules.chart import openChart
from modules.percentageCountList import percentageCountList
lines = tuple(open('data.txt', 'r'))
"""
Part 1: Calculated Attendance Percentage
"""
print("Calculated Attendance Percentage:")
print("Name ID Percentage Marks")
for row in result(lines):
printRow(row[0], row[1], row[2])
"""
Part 2: Attendance Percentage (Student Count)
"""
print("\n\n")
print("Attendance Percentage (Student Count):")
print("Percentage Count")
p = [70, 60, 45, 30]
for i, percentage in enumerate(p):
upper = p[i - 1] - 1
lower = p[i]
if i == 0:
upper = 100
if percentage == 30:
lower = 0
print(str(percentage) + "%\t\t" +
str(percentageCount([upper, lower], lines)))
"""
Part 3: Draw piechart of student attendence percentages
"""
openChart(percentageCountList(percentageCount, lines))