-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.py
More file actions
154 lines (137 loc) · 6.19 KB
/
Copy pathStudent.py
File metadata and controls
154 lines (137 loc) · 6.19 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
names = []
ages = []
Ids = []
addresses = []
Gpas = []
size = 0
iscreated = False
def show_Menu() :
print("\t\t\t\t\t Wellcome to student managment System ")
print("1 - Add Student Record .")
print("2 - Update Student Record .")
print("3 - Delete Student Record .")
print("4 - Create Result of Student Record .")
print("5 - View all Student Record .")
print("6 - Exiting ! ---------------")
while True :
show_Menu()
choice = int(input("Enter your choice : "))
if choice == 1 :
size = int(input("Enter how many students data you want to enter : "))
for i in range (size) :
name = input(f"Enter name of Student {i+1} : ")
names.append(name)
age = int(input(f"Enter age of Studnet {i+1} : "))
ages.append(age)
Id = int(input(f"Enter Id of Student {i+1} : "))
Ids.append(Id)
address = input(f"Enter address of Student {i+1} : ")
addresses.append(address)
Gpa = input(f"Enter Gpa of Student {i+1} : ")
Gpas.append(Gpa)
print("------------------------------------------------------")
iscreated = True
print("Records Add Successfully.")
elif choice == 2 :
print("\t\t\t\t Wellcome to upgradation proccess")
searchedName = input("Enter name of student whose data you want to update : ")
if iscreated :
for i in range (size) :
if searchedName in names :
print("Name of student : ",name)
print("Age of student : ",age)
print("Id of student : ",Id)
print("Address of student : ",address)
print("Gpa of student : ",Gpa)
update = input("Enter update to update it : ")
if update == "update" :
index = names.index(searchedName)
new_name = input("Enter new name : ")
names[index] = new_name
new_age = int(input("Enter new age : "))
ages[index] = new_age
new_Id = input("Enter new Id :")
Ids[index] = new_Id
new_address = input("Enter new Address : ")
addresses[index] = new_address
new_Gpa = input("Enter new Gpa : ")
Gpas[index] = new_Gpa
print("------------------------------------------------------")
else :
print("No record found.")
elif choice == 3 :
print("\t\t\t Account Deletion proccess")
searchs = input("Enter name of student whose record you want to delete : ")
if searchs in names :
if iscreated :
print("Name of student : ",name)
print("Age of student : ",age)
print("Id of student : ",Id)
print("Address of student : ",address)
print("Gpa of student : ",Gpa)
delete = input("Enter delete for deletion proccess : ")
if delete == "delete" :
index = names.index(searchs)
names.pop(index)
ages.pop(index)
Ids.pop(index)
addresses.pop(index)
Gpas.pop(index)
iscreated = False
print("------------------------------------------------------")
else :
print("Invalid Input name .")
elif choice == 4 :
if iscreated :
searchName = input("Enter the serached name : ")
if searchName in names :
print(f"\t\t Result creating proccess of {names[i]} : ")
# marks = []
# OOP = int(input("Enter marks in OOP : "))
# marks.append(OOP)
# OOP_LAB = int(input("Enter marks in OOP LAB : "))
# marks.append(OOP_LAB)
# DS = int(input("Enter marks in Discrete Structure : "))
# marks.append(DS)
# DLD = int(input("Enter marks in DLD : "))
# marks.append(DLD)
# DLD_LAB = int(input("Enter marks in DLD LAB : "))
# marks.append(DLD_LAB)
# print("OOP : ",marks[0])
# print("OOP LAB : ",marks[1])
# print("Discrete Structure : ",marks[2])
# print("DLD : ",marks[3])
# print("DLD LAB : ",marks[4])
CreditHours = []
OOP = float(input("Enter Credit Percentage in OOP out of 12 : "))
CreditHours.append(OOP)
OOP_LAB = float(input("Enter Credit Percentage in OOP LAB out of 4 : "))
CreditHours.append(OOP_LAB)
DS = float(input("Enter Credit Percentage in Discrete Structure out of 12 : "))
CreditHours.append(DS)
DLD = float(input("Enter credit percentage in DLD out of 8 : "))
CreditHours.append(DLD)
DLD_LAB = float(input("Enter Credit Percentage in DLD LAB out of 4 : "))
CreditHours.append(DLD_LAB)
print("OOP : ",CreditHours[0])
print("OOP LAB : ",CreditHours[1])
print("Discrete Structure : ",CreditHours[2])
print("DLD : ",CreditHours[3])
print("DLD LAB : ",CreditHours[4])
Gpacalcutate = sum(CreditHours) / 10
print(" Gpa :" ,Gpacalcutate )
# Average = marks/5
# print("Average : ",Average)
else :
print("No name found-------Error ! 404 .")
elif choice == 5 :
if iscreated :
print("\t\t\t\t Showing all records")
for i in range (len(names)) :
print(f"{i+1} Name {names[i]}: \nAge {ages[i]} : \nId {Ids[i]} : \naddress {addresses[i]} : \nGpa {Gpas[i]} : ")
else :
print("no record found ------------------Error ! 404 .")
elif choice == 6:
print("Exiting ! ------------------")
else :
print("Invalid Input ")