-
Notifications
You must be signed in to change notification settings - Fork 150
/
CGPA_Calculator.py
45 lines (23 loc) · 1.44 KB
/
CGPA_Calculator.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
course1 = float(input("Enter Credit of 1st Course: "))
course1_cg = float(input("Enter desired GPA of 1st Course: "))
course2 = float(input("Enter Credit of 2nd Course: "))
course2_cg = float(input("Enter desired GPA of 2nd Course: "))
course3 = float(input("Enter Credit of 3rd Course: "))
course3_cg = float(input("Enter desired GPA of 3rd Course: "))
course4 = float(input("Enter Credit of 4th Course: "))
course4_cg = float(input("Enter desired GPA of 4th Course: "))
course5 = float(input("Enter Credit of 5th Course: "))
course5_cg = float(input("Enter desired GPA of 5th Course: "))
course6 = float(input("Enter Credit of 6th Course: "))
course6_cg = float(input("Enter desired GPA of 6th Course: "))
course7 = float(input("Enter Credit of 7th Course: "))
course7_cg = float(input("Enter desired GPA of 7th Course: "))
course8 = float(input("Enter Credit of 8th Course: "))
course8_cg = float(input("Enter desired GPA of 8th Course: "))
course9 = float(input("Enter Credit of 9th Course: "))
course9_cg = float(input("Enter desired GPA of 9th Course: "))
credits = course1+course2+course3+course4+course5+course6+course7+course8+course9
print("Total Credits: ", credits)
total_GP = ((course1*course1_cg) + (course2*course2_cg) + (course3*course3_cg) + (course4*course4_cg) + (course5*course5_cg) + (course6*course6_cg) + (course7*course7_cg) + (course8*course8_cg) + (course9*course9_cg))
GPA = total_GP/credits
print("Your GPA", round(GPA, 2))