#
# Copyright 2023, Ali Arya
# Anyone Can Code: Algorithmic Thinking
# Example 6.4p
#

#encapsulation thorugh classes in Python

#global data
numStudents = 0

class Student:
    """A simple Student class"""
    ID = 0
    Grades = None
    GPA = 0

    #constructor
    def __init__(self):
        global numStudents
        self.ID = 1000 + numStudents
        numStudents += 1
        self.Grades = [-1] * 20
        self.GPA = -1

    #destructor
    def __del__(self):
        print("object deleted")

    #other functions
    def Print(self):
        for i in range(0,20):
            print(self.Grades[i])
        print(self.GPA)

s1 = Student();
s1.Print()
