Answered step by step
Verified Expert Solution
Question
1 Approved Answer
everything in the program is working well but the calculation of the cgpa is not. I want this problem to be solved by calculating the
everything in the program is working well but the calculation of the cgpa is not. I want this problem to be solved by calculating the cgpa in the right way
def GPA(score):
if(score>=89.5):
return "4.0"
if(score<=89.49 and score>=86.50):
return "3.7"
if(score<=86.49 and score>=83.50):
return "3.3"
if(score<=83.49 and score>=79.50):
return "3.0"
if(score<=79.49 and score>=76.50):
return "2.7"
if(score<=76.49 and score>=73.50):
return "2.3"
if(score<=73.49 and score>=69.50):
return "2.0"
if(score<= 69.49 and score>=66.50):
return "1.7"
if(score<=66.49 and score>=63.50):
return "1.3"
if(score<=63.49 and score>=59.50):
return "1.0"
else:
return "0.0"
def report(total,advisor):
if(total>90):
print("Excellent")
if(total<90 and total>79):
print("Very Good")
if(total<80 and total>69):
print("Good")
if(total<70 and total>59):
print("Average")
if(total<60 ):
print("A disappointing GPA this semester. must try much harder next semester to imporve your GPA.")
print("You must talk to your student advisor,"+advisor +", as soon as possible")
name =input("What is your name? ")
studentID = input("what is your student H i/d number? ")
print("SEMESTER GRADE REPORT FOR:")
print("------******-------")
major=input("what is your major? ")
advisor=input("what is the name of your student advisor? ")
coordinator=input("what is the name of your programme coordinator ? ")
print("-------------")
score=[]
total=0.0
for i in range (0,5):
sc=float(input("what is your score for subject %d? "%(i+1)))
score.append(sc)
print("-------------")
for i in range (0,5):
total1=sum(score)
print("Your score for subject %s and your GPA score for subject %d is: %s" %(str(score[i]),(i+1) ,GPA(score[i])))
score.append(sc)
print("------*******-------")
avg=total/ len(score)
#print(avg)
print("Your cummulative GPA (CGPA) for the semester is: %s" % GPA(avg))
print("------*******-------")
report(avg,advisor)
print("------*******-------")
print("This complete the grade report for %s %s for this semester" %(studentID , name))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started