<jupyter_start><jupyter_text>Application 11. Create a python program that displays the name of three students (Student 1, Student 2, Student 3) and their term grades2. Create a class name Person and attributes - std1, std2, std3,pre,mid,fin3. Compute the average of each term grade using Grade() method4. Information about student's grades must be hidden from others<jupyter_code>class Student_grade:
  def __init__(self,term_grade):
    self.term_grade = term_grade

  def Terms(self):
    print(f"{self.term_grade} Prelim   Midterms    Finals \n")
  def student1(self):
    print(f"{self.term_grade}1.5   1.5   1.5")
  def student2(self):
    print(f"{self.term_grade}1.5   1.75  1.6")
  def student3(self):
    print(f"{self.term_grade}1.5   1.75  1.6")

terms = Student_grade("Grading Period:")
St_1 = Student_grade("       Std1: ")
St_2 = Student_grade("       Std2: ")
St_3 = Student_grade("       Std3: ")

terms.Terms()
St_1.student1()
St_2.student2()
St_3.student3()

class Student_grade:
  def __init__(self,term_grade):
    self.term_grade = term_grade

  def Terms(self):
    print(f"{self.term_grade} Term Grade \n")
  def student1(self):
    print(f"{self.term_grade}     1.5   ")
  def student2(self):
    print(f"{self.term_grade}     1.5   ")
  def student3(self):
    print(f"{self.term_grade}     1.75   ")

term1 = Student_grade("1st Semester:")
St_1 = Student_grade("Student 1: ")
St_2 = Student_grade("Student 2: ")
St_3 = Student_grade("Student 3: ")

term1.Terms()
St_1.student1()
St_2.student2()
St_3.student3()
print("\n")

class person_n_attributes:
  def __init__(self,term_grades):
    self.term_grades = term_grades

  def Terms(self):
    print(f"{self.term_grades} Prelim   Midterms    Finals \n")
  def student1(self):
    print(f"{self.term_grades}     1.5       1.5        1.5")
  def student2(self):
    print(f"{self.term_grades}     1.5       1.75       1.6")
  def student3(self):
    print(f"{self.term_grades}     1.5       1.75       1.6")

terms = person_n_attributes("Grading Period:")
Std_1 = person_n_attributes("      Std1:   ")
Std_2 = person_n_attributes("      Std2:   ")
Std_3 = person_n_attributes("      Std3:   ")

terms.Terms()
Std_1.student1()
Std_2.student2()
Std_3.student3()
class Student_grade:
  def __init__(self,term_grade):
    self.__term_grade = term_grade

  def Terms(self):
    print(f"{self.__term_grade} Term Grade \n")
  def student1(self):
    print(f"{self.__term_grade}     1.5   ")
  def student2(self):
    print(f"{self.__term_grade}     1.5   ")
  def student3(self):
    print(f"{self.__term_grade}     1.75   ")

term1 = Student_grade("1st Semester:")
St_1 = Student_grade("Student 1: ")
St_2 = Student_grade("Student 2: ")
St_3 = Student_grade("Student 3: ")

term1.Terms()
St_1.student1()
St_2.student2()
St_3.student3()
print("\n")

class person_n_attributes:
  def __init__(self,term_grades):
    self.__term_grades = term_grades

  def Terms(self):
    print(f"{self.__term_grades} Prelim   Midterms    Finals \n")
  def student1(self):
    print(f"{self.__term_grades}     1.5       1.5        1.5")
  def student2(self):
    print(f"{self.__term_grades}     1.75      1.5        1.5")
  def student3(self):
    print(f"{self.__term_grades}     2.0       1.75       1.5")

terms = person_n_attributes("Grading Period:")
Std_1 = person_n_attributes("     Std1:   ")
Std_2 = person_n_attributes("     Std2:   ")
Std_3 = person_n_attributes("     Std3:   ")


class ave_grade:
  def __init__(self,pre,mid,fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grades(self):
    return (self.__pre + self.__mid + self.__fin)/3

terms.Terms()
Std_1.student1()
Std_2.student2()
Std_3.student3()
print("\n")

print("Computation of your grade:")
prelim = float(input("Prelim grade: "))
midterm = float(input("Midterm grade: "))
final = float(input("Finals grade: "))
add_all = ave_grade(prelim,midterm,final)
print("\nFinal Average: ",add_all.Grades())   

class ave_grade:
  def __init__(self,pre,mid,fin):
    self.pre = pre
    self.mid = mid
    self.fin = fin

  def Grades(self):
    q =  self.pre + self.mid + self.fin
    b = q/3
    print("\n",b)

q = ave_grade(1.2,2.0,1.75)
q.Grades()
class foo:
  def __init__(self, a,b,c):
    self.a = a    
    self.b = b
    self.c = c
  def add(self):
    return (self.a + self.b + self.c)/3

computation = foo(1.2,1.5,1.75)

print("final answer: ", computation.add())
class person_n_attributes:
  def __init__(self,term_grade):
    self.__term_grade = term_grade

  def Terms_1(self):
    print(f"{self.__term_grade} Term Grade \n")
  def student1(self):
    print(f"{self.__term_grade}     1.5   ")
  def student2(self):
    print(f"{self.__term_grade}     1.5   ")
  def student3(self):
    print(f"{self.__term_grade}     1.75   ")

  def Terms(self):
    print(f"{self.__term_grade} Prelim   Midterms    Finals \n")
  def student_1(self):
    print(f"{self.__term_grade}      1.5       1.5        1.5")
  def student_2(self):
    print(f"{self.__term_grade}      1.5       1.75       1.5")
  def student_3(self):
    print(f"{self.__term_grade}      2.0       1.75       1.5")

term1 = person_n_attributes("1st Semester:")
St_1 = person_n_attributes("Student 1: ")
St_2 = person_n_attributes("Student 2: ")
St_3 = person_n_attributes("Student 3: ")
babe = person_n_attributes("Grading Period:")

term1.Terms_1()
St_1.student1()
St_2.student2()
St_3.student3()
print("\n")

babe.Terms()
St_1.student_1()
St_2.student_2()
St_3.student_3()

class ave_grade:
  def __init__(self,pre,mid,fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grades(self):
    return (self.__pre + self.__mid + self.__fin)/3

print("\n")
print("Computation of grade:")
prelim = float(input("Prelim grade:  "))
midterm = float(input("Midterm grade: "))
final = float(input("Finals grade:  "))
add_all = ave_grade(prelim,midterm,final)
print("\nFinal Average: ",add_all.Grades())   

class ave_grade:
  def __init__(self,pre,mid,fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grades(self):
    return (self.__pre + self.__mid + self.__fin)/3

print("\n")
a = ave_grade(1.5,1.5,1.5)
b = ave_grade(1.5,1.75,1.5)
c = ave_grade(2.0,1.75,1.5)
print("Final Grade:")
print("Student 1: ",a.Grades())
print("Student 2: ",b.Grades())
print("Student 3: ",c.Grades())
class person_n_attributes:
  def __init__(self,term_grade):
    self.__term_grade = term_grade

  def Terms_1(self):
    print(f"{self.__term_grade} Term Grade \n")
  def student1(self):
    print(f"{self.__term_grade}     1.5   ")
  def student2(self):
    print(f"{self.__term_grade}     1.5   ")
  def student3(self):
    print(f"{self.__term_grade}     1.75   ")

  def Terms(self):
    print(f"{self.__term_grade} Prelim   Midterms    Finals \n")
  def student_1(self):
    print(f"{self.__term_grade}      1.5       1.5        1.5")
  def student_2(self):
    print(f"{self.__term_grade}      1.5       1.75       1.5")
  def student_3(self):
    print(f"{self.__term_grade}      2.0       1.75       1.5")

term1 = person_n_attributes("1st Semester:")
St_1 = person_n_attributes("Student 1: ")
St_2 = person_n_attributes("Student 2: ")
St_3 = person_n_attributes("Student 3: ")
babe = person_n_attributes("Grading Period:")

term1.Terms_1()
St_1.student1()
St_2.student2()
St_3.student3()
print("\n")

babe.Terms()
St_1.student_1()
St_2.student_2()
St_3.student_3()

class ave_grade:
  def __init__(self,pre,mid,fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grades(self):
    return (self.__pre + self.__mid + self.__fin)/3

print("\n")
a = ave_grade(1.5,1.5,1.5)
b = ave_grade(1.5,1.75,1.5)
c = ave_grade(2.0,1.75,1.5)
print("Final Grade:")
print("Student 1: ",a.Grades())
print("Student 2: ",b.Grades())
print("Student 3: ",c.Grades())
class Person:
  def __init__(self,pre,mid,fin,):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grade_1(self):
    return (self.__pre + self.__mid + self.__fin)/3
  def Grade_2(self):
    return (self.__pre + self.__mid + self.__fin)/3
  def Grade_3(self):
    return (self.__pre + self.__mid + self.__fin)/3

average1 = Person(1.25, 1.50, 1.50)
average2 = Person(1.27,1.50,1.75)
average3 = Person(1.27,1.50,1.75)

print(average1.Grade_1())
print(average2.Grade_2())
print(average3.Grade_3())
class person_n_attributes:
  def __init__(self,term_grade):
    self.__term_grade = term_grade

  def Terms_1(self):
    print(f"{self.__term_grade} Term Grade \n")
  def student1(self):
    print(f"{self.__term_grade}     1.5   ")
  def student2(self):
    print(f"{self.__term_grade}     1.5   ")
  def student3(self):
    print(f"{self.__term_grade}     1.75   ")

  def Terms(self):
    print(f"{self.__term_grade} Prelim   Midterms    Finals \n")
  def student_1(self):
    print(f"{self.__term_grade}      1.5       1.5        1.5")
  def student_2(self):
    print(f"{self.__term_grade}      1.5       1.75       1.5")
  def student_3(self):
    print(f"{self.__term_grade}      2.0       1.75       1.5")

term1 = person_n_attributes("1st Semester:")
St_1 = person_n_attributes("Student 1: ")
St_2 = person_n_attributes("Student 2: ")
St_3 = person_n_attributes("Student 3: ")
babe = person_n_attributes("Grading Period:")

term1.Terms_1()
St_1.student1()
St_2.student2()
St_3.student3()
print("\n")

babe.Terms()
St_1.student_1()
St_2.student_2()
St_3.student_3()

class ave_grade:
  def __init__(self,pre,mid,fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grades(self):
    return (self.__pre + self.__mid + self.__fin)/3
  

print("\n")
print("Computation of grade:")


prelim = float(input("Student 1:\nPrelim grade:  "))
midterm = float(input("Midterm grade: "))
final = float(input("Finals grade:  "))
add_all_1 = ave_grade(prelim,midterm,final)
print("\nFinal Grade: ",add_all_1.Grades())

prelim2 = float(input("\nStudent 2:\nPrelim grade:  "))
midterm2 = float(input("Midterm grade: "))
final2 = float(input("Finals grade:  "))
add_all_2 = ave_grade(prelim2,midterm2,final2)
print("\nFinal Grade: ",add_all_2.Grades())

prelim3 = float(input("\nStudent 3:\nPrelim grade:  "))
midterm3 = float(input("Midterm grade: "))
final3 = float(input("Finals grade:  "))
add_all_3 = ave_grade(prelim3,midterm3,final3)
print("\nFinal Grade: ",add_all_3.Grades())<jupyter_output>1st Semester: Term Grade 

Student 1:      1.5   
Student 2:      1.5   
Student 3:      1.75   


Grading Period: Prelim   Midterms    Finals 

Student 1:       1.5       1.5        1.5
Student 2:       1.5       1.75       1.5
Student 3:       2.0       1.75       1.5


Computation of grade:
Student 1:
Prelim grade:  1
Midterm grade: 2
Finals grade:  1

Final Grade:  1.3333333333333333

Student 2:
Prelim grade:  1
Midterm grade: 2
Finals grade:  2

Final Grade:  1.6666666666666667

Student 3:
Prelim grade:  1
Midterm grade: 3
Finals grade:  4

Final Grade:  2.6666666666666665<jupyter_text>baba<jupyter_code>class person_n_attributes:
  def __init__(self,term_grade):
    self.__term_grade = term_grade

  def Terms_1(self):
    print(f"{self.__term_grade} Term Grade ")
  def student1(self):
    print(f"{self.__term_grade}     1.5   ")
  def student2(self):
    print(f"{self.__term_grade}     1.5   ")
  def student3(self):
    print(f"{self.__term_grade}     1.75   ")

  def Terms(self):
    print(f"{self.__term_grade} Prelim   Midterms    Finals \n")
  def student_1(self):
    print(f"{self.__term_grade}      1.5       1.5        1.5")
  def student_2(self):
    print(f"{self.__term_grade}      1.5       1.75       1.5")
  def student_3(self):
    print(f"{self.__term_grade}      2.0       1.75       1.5 \n")

term1 = person_n_attributes("1st Semester:")
St_1 = person_n_attributes("Student 1: ")
St_2 = person_n_attributes("Student 2: ")
St_3 = person_n_attributes("Student 3: ")
babe = person_n_attributes("Grading Period:")

term1.Terms_1()
St_1.student1()
St_2.student2()
St_3.student3()
print("\n")

babe.Terms()
St_1.student_1()
St_2.student_2()
St_3.student_3()

class ave_grade:
  def __init__(self):
    self.__pre = float(input("Prelim grade:  "))
    self.__mid = float(input("Midterm grade: "))
    self.__fin = float(input("Finals grade:  "))

  def Grades(self):
    return (self.__pre + self.__mid + self.__fin)/3
  
  def name(self):
    print("Student 1:")

  def name_2(self):
    print("Student 2:")
    
  def name_3(self):
    print("Student 3:")

print("Computation of grade:")
add_all_1.name()
add_all_1 = ave_grade()
print("   Final Average: ",add_all_1.Grades(),"\n")

add_all_2.name_2()
add_all_2 = ave_grade()
print("   Final Average: ",add_all_2.Grades(),"\n")

add_all_2.name_3()
add_all_3 = ave_grade()
print("   Final Average: ",add_all_3.Grades(),"\n")
class Person:

     def __init__(self):
         self.firstname = input('Enter first name:  ')
         self.lastname = input('Enter last name:  ') 
     def show_full_name(self):
         return self.firstname + ' ' + self.lastname
#creating an object with the class
person2 = Person()
person2.show_full_name()
class person_n_attributes:
  def __init__(self,term_grade):
    self.__term_grade = term_grade

  def Terms(self):
    print(f"{self.__term_grade} Prelim   Midterms    Finals ")
  def student_1(self):
    print(f"{self.__term_grade}      1.5       1.5        1.5")
  def student_2(self):
    print(f"{self.__term_grade}      1.5       1.75       1.5")
  def student_3(self):
    print(f"{self.__term_grade}      2.0       1.75       1.5 \n")

Std_1 = person_n_attributes("Student 1: ")
Std_2 = person_n_attributes("Student 2: ")
Std_3 = person_n_attributes("Student 3: ")
babe = person_n_attributes("Grading Period:")

babe.Terms()
Std_1.student_1()
Std_2.student_2()
Std_3.student_3()

class ave_grade(person_n_attributes):
  def __init__(self):
    self.__pre = float(input("Prelim grade:  "))
    self.__mid = float(input("Midterm grade: "))
    self.__fin = float(input("Finals grade:  "))

  def Grades(self):
    return (self.__pre + self.__mid + self.__fin)/3

class name_std(person_n_attributes):
  def __init__(self, std_name):
    self.std_name = std_name
  def name(self):
    return "Student 1:"
  def name_2(self):
    return "Student 2:"
  def name_3(self):
    return "Student 3:"

std1 = name_std(" ")
std2 = name_std(" ")
std3 = name_std(" ")

print("Computation of grade:")
print(std1.name())
add_all_1 = ave_grade()
print("   Final Average: ",add_all_1.Grades(),"\n")

print(std2.name_2())
add_all_2 = ave_grade()
print("   Final Average: ",add_all_2.Grades(),"\n")

print(std3.name_3())
add_all_3 = ave_grade()
print("   Final Average: ",add_all_3.Grades(),"\n")

print("1st Semester: Term Grade")
print(std1.name()  , add_all_1.Grades())
print(std2.name_2(), add_all_2.Grades())
print(std3.name_3() , add_all_3.Grades())
class person_n_attributes:

  class ave_grade(person_n_attributes):
    def __init__(self):
      self.__pre = float(input("Prelim grade:  "))
      self.__mid = float(input("Midterm grade: "))
      self.__fin = float(input("Finals grade:  "))

    def Grades(self):
     return (self.__pre + self.__mid + self.__fin)/3

class name_std(person_n_attributes):
  def __init__(self, std_name):
    self.std_name = std_name
  def name(self):
    return "Student 1:"
  def name_2(self):
    return "Student 2:"
  def name_3(self):
    return "Student 3:"

std1 = name_std(" ")
std2 = name_std(" ")
std3 = name_std(" ")

print("Computation of grade:")
print(std1.name())
add_all_1 = ave_grade()
print("   Final Average: ",add_all_1.Grades(),"\n")

print(std2.name_2())
add_all_2 = ave_grade()
print("   Final Average: ",add_all_2.Grades(),"\n")

print(std3.name_3())
add_all_3 = ave_grade()
print("   Final Average: ",add_all_3.Grades(),"\n")

class grading_period(person_n_attributes):
  def __init__(self,term_grade):
    self.__term_grade = term_grade

  def Terms(self):
    print("Grading Period: Prelim   Midterms    Finals ")
  def student_1(self):
    print("Student 1:",self.__pre,"       ",self.__mid,"        ",self.__fin)
  def student_2(self):
    print("Student 2: ",self.__pre,"       ",self.__mid,"       ",self.__fin)
  def student_3(self):
    print("Student 3: ",self.__pre,"       ",self.__mid,"       ",self.__fin )

st1 = ave_grade()
st2 = ave_grade()
st3 = ave_grade()

st1.student_1()
st2.student_2()
st3.student_3()


print("1st Semester: Term Grade")
print(std1.name()  , add_all_1.Grades())
print(std2.name_2(), add_all_2.Grades())
print(std3.name_3() , add_all_3.Grades())
class Person:
  def __init__(self, Pre, Mid, Fin):
    self.__Pre = Pre
    self.__Mid = Mid
    self.__Fin = Fin
  def Grades(self):
      return(self.__Pre + self.__Mid + self.__Fin)/3
class std1_3(Person):
  def __init__(self,std):
    self.std = std
  def stdi(self):
    return "student 1"
  def std2(self):
    return "student 2"
  def std3(self):
    return "student 3"



Prelim_1 = float(input("student 1 Prelim Grade: "))
Midterm_1 = float (input("student 1 Midterm Grade: "))
Finals_1 = float(input("Student 1 Finals Grade: "))
Average_1 = Person(Prelim_1, Midterm_1, Finals_1)
Average_1.Grades()
Prelim_2= float(input("student 2 Prelim Grade: "))
Midterm_2 = float(input("Student 2 Midterm Grade: "))
Finals_2 = float(input("student 2 Finals Grade: "))
Average_2 = Person(Prelim_2, Midterm_2, Finals_2)
Average_2.Grades ()
Prelin_3 = float(input("Student 3 Prelim Grade: "))
Midterm_3 = float(input("student 3 Midterm Grade: "))
Finals_3 = float(input("student 3 Finals Grade: "))
Average_3 = Person(Prelin_3,Midterm_3,Finals_3)
Average_3.Grades()


mare1 = std1_3("-")
mare2 = std1_3("-")
mare3 = std1_3("-")
mare1.stdi()
mare2.std2()
mare3.std3()


print("\n")
print("Grades Breakdown", "\n")
print("Grading Period", "\t", "\t", "Prelims","\t", "Midterm", "\t", "Finals", "\t","Average Grade")
print(mare1.stdi(),"\t","\t", Prelim_1, "\t", "\t", Midterm_1, "\t","\t", Finals_1, "\t","\t", Average_1.Grades ())
print(mare2.std2(),"\t","\t", Prelim_2, "\t", "\t", Midterm_2, "\t","\t", Finals_2, "\t","\t", Average_2.Grades())
print(mare3.std3(),"\t","\t", Prelin_3, "\t", "\t", Midterm_3, "\t","\t", Finals_3, "\t","\t", Average_3.Grades ())



print("\n")
print("Student 1 Average Grade: {:.2f}".format(Average_1.Grades ()))
print("student 2 Average Grade: {:.2f}". format(Average_2.Grades()))
print("Student 3 Average Grade: {:.2f}".format(Average_3.Grades ()))<jupyter_output>student 1 Prelim Grade: 1
student 1 Midterm Grade: 1
Student 1 Finals Grade: 1.2
student 2 Prelim Grade: 1.2
Student 2 Midterm Grade: 1.2
student 2 Finals Grade: 1
Student 3 Prelim Grade: 1.5
student 3 Midterm Grade: 1.5
student 3 Finals Grade: 1


Grades Breakdown 

Grading Period 	 	 Prelims 	 Midterm 	 Finals 	 Average Grade
student 1 	 	 1.0 	 	 1.0 	 	 1.2 	 	 1.0666666666666667
student 2 	 	 1.2 	 	 1.2 	 	 1.0 	 	 1.1333333333333333
student 3 	 	 1.5 	 	 1.5 	 	 1.0 	 	 1.3333333333333333


Student 1 Average Grade: 1.07
student 2 Average Grade: 1.13
Student 3 Average Grade: 1.33
{'fraction_non_alphanumeric': 0.15663856691253952, 'fraction_numerical': 0.04910432033719705, 'mean_word_length': 3.5947712418300655, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '640849', 'license': 'Apache-2.0', 'n_tokens_mistral': 7695, 'n_tokens_neox': 7269, 'n_words': 1510, 'path': 'Oop_namin.ipynb', 'repo_name': '12honan/projects2', 'size': '18980'}