'''lecture_25_student.py
Our very first class! Represents a Student
Oliver W. Layton
CS 151: Computational Thinking: Visual Media
Spring 2021

TODO:
Make Student class with methods:
- Constructor with 2 parameters: name and year
- get methods
- set methods
    - Main code: Create two students, get and print their names and years
    - Main code: Loop thru students calling common method
    - Main code: Set one of their years, print both years
    - Discuss self parameter in method definition vs calling method.
- Function vs method: wite a printName() as function and method. Show differences.
- Calling methods inside class: Add grades IV, write addGrade printGrades methods.
- Add gpa to constuctor (show keyword args)
- addBonusPoints method
'''
class Student:
    def __init__(self, name, year):
        '''The Student constructor'''
        # print('name is:', name)
        # print('year is:', year)

        # defining instance variances called name (self.name) and year (self.year) based on
        # function parameter values (name) and (year)
        self.name = name
        self.year = year

    def getName(self):
        '''get the student's name stored in the instance variable self.name'''
        return self.name # <- instance variables live on throughout the object
        # return name <- does not work! name was a variable that went away after constructor ended


if __name__ == '__main__':
    jane = Student('Jane', 2021)
    print('The student\'s name:', jane.getName())
