-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhashTest.py
77 lines (60 loc) · 2.07 KB
/
hashTest.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from school_content import *
from hashing_function import *
import numpy as np
S = StudentHashTable()
while True:
print("Select one of the options from below:\n Enter the option number to perform that action. \n")
print("[1]. Add a Student\n")
print("[2]. Search for a Student\n")
print("[3]. Add grades for a student\n")
print("[4]. Make grade calculations for a student\n")
print("[5]. Print the Student List\n")
print("[6]. To Exit the Program\n")
print("[7]. To generate entire class report (creates a .txt file showing report)\n")
option = input()
if option == "1":
S.insertStudent()
elif option == "2":
while True:
sID = input('Provide Student ID: ')
if len(sID) == 9:
break
else:
print("Invalid Student ID entered. Please try again.")
S.getStudentInfo(sID)
elif option == "3":
while True:
sID = input('Provide Student ID: ')
if len(sID) == 9:
break
else:
print("Invalid Student ID entered. Please try again.")
modify_student = S.getStudent(sID)
while True:
modify_student.add_grade()
response = input("Press <R> to grade another assignment, press any key to finish")
if response == "R":
continue
else:
break
elif option == "4":
while True:
sID = input('Provide Student ID: ')
if len(sID) == 9:
break
else:
print("Invalid Student ID entered. Please try again.")
calc_student = S.getStudent(sID)
calc_student.sort_grades()
calc_student.calculate_grade_quartiles()
calc_student.calculate_average()
elif option == "5":
print(S)
elif option == "6":
print("Program exited")
break
elif option == "7":
f = open("classReport.txt", "w+")
f.write(str(S))
else:
print("Choose the correct option. Please Try Again")