'''lecture_24_csstudent.py Show inheritance with the CSStudent (child class) that inherits from ColbyStudent (parent class) TODO: 1. is-a relationship 2. CSStudent constructor signature: def __init__(self, name, year, favLang) - Show with redundant code. - Code reuse: call parent constructor (with super() and directly) 3. When instance variables in parent inherited by child - Show __init__ with/without calling parent constructor 4. set/get methods for CSStudent-specific vars - Show access with ColbyStudent and CSStudent objects 5. Write printGrades in parent (100 point scale) - Show OVERRIDE in child (30 point scale) - Show EXTENDING in (both scales) 6. Symbol table for `newCSStudent.printGrades()` and `newColbyStudent.printGrades()` Oliver W. Layton CS 151: Computational Thinking: Visual Media Fall 2020 ''' if __name__ == '__main__': colbyStu = ColbyStudent('Jane', 2022) csStu = CSStudent('Jim', 2024, 'Python') print('CS Student fav language:', csStu.getFavLang()) # print('Colby Student fav language:', colbyStu.getFavLang()) csStu.addGrade(80) csStu.addGrade(90) csStu.addGrade(100) print('Grades:') csStu.printGrades()