About
class internalmarks: def _init_(self,p1,p2,eval1,eval2,eval3): self.p1=p1 self.p2=p2 self.eval1=eval1 self.eval2=eval2 self.eval3=eval3 def displayinternal(self): print("periodical1: "+str(self.p1)) print("periodical2: "+str(self.p2)) print("Lab evaluation1: "+str(self.eval1)) print("Lab evaluation2: "+str(self.eval2)) print("Lab evaluation3: "+str(self.eval3))
class externalmarks(): def _init_(self,endex,endvi): self.endex=endex self.endvi=endvi def displayexternal(self): print("online exam: "+str(self.endex)) print("viva: "+str(self.endvi))
class student: def _init_(self,name,roll): self.name=name self.roll=roll def displaystudent(self): print("student name: "+self.name+"\n") print("roll number: "+self.roll+"\n")
class grade(student,internalmarks,externalmarks): def _init_(self, name, roll, p1, p2, eval1, eval2, eval3, endex, endvi): student._init_(self, name, roll) internalmarks._init_(self, p1, p2, eval1, eval2, eval3) externalmarks._init_(self, endex, endvi) self.total = (p1 + p2 + eval1 + eval2 + eval3 + endex + endvi) def gradecalculation(self): if(self.total>=91 and self.total<=100): self.grade='A' elif(self.total>=81 and self.total<=90): self.grade='B' elif(self.total>=61 and self.total<=80): self.grade='P' elif (self.total<=60): self.grade='F'
print("Total mark: "+str(self.total))
print("Grade: "+self.grade)
n=int(input()) if(n==1): name=input() roll=input() c=student(name,roll) c.displaystudent() elif(n==2): p1=int(input()) p2=int(input()) eval1=int(input()) eval2=int(input()) eval3=int(input()) a=internalmarks(p1,p2,eval1,eval2,eval3) a.displayinternal() elif(n==3): endex=int(input()) endvi=int(input()) b=externalmarks(endex,endvi) b.displayexternal() elif(n==4): name=input() roll=input() p1=int(input()) p2=int(input()) eval1=int(input()) eval2=int(input()) eval3=int(input()) endex=int(input()) endvi=int(input()) c=student(name,roll) c.displaystudent() a=internalmarks(p1,p2,eval1,eval2,eval3) a.displayinternal() b=externalmarks(endex,endvi) b.displayexternal()
d=grade(name,roll,p1,p2,eval1,eval2,eval3,endex,endvi)
d.gradecalculation()
n=0; def _init_(self,a,b,c,d,e): self.a=a self.b=b self.c=c self.d=d self.e=e def _add_(self,other): self.a=self.a+other.a self.b=self.b+other.b self.c=self.c+other.c self.d=self.d+other.d self.e=self.e+other.e score_card.n=score_card.n+1 return self
def display_total(self):
print(self.a,self.b,self.c,self.d,self.e)
def average(self):
print(self.a/self.n,self.b/self.n,self.c/self.n,self.d/self.n,self.e/self.n)
def result(self):
if ((self.a/self.n+self.b/self.n+self.c/self.n+self.d/self.n+self.e/self.n)/5>=50 and self.a/self.n>=40 and self.b/self.n>=40 and self.c/self.n>=40 and self.d/self.n>=40 and self.e/self.n>=40):
print("PASS")
else:
print("FAIL")