# This program has two classes:
#   Class Student is constructed with a name.
#   In addition to names, students have years: "Freshman", "Sophomore", etc.
#   Class Student has 2 methods: SetYear() and Join( ) for joining clubs

#   Class Club is also constructed with a club name.
#   The methods for class Club are AddMember( ) and Print( ).

#   Finally, the program has one Club, named "Python Coders".  This
#   club has 3 members: bob" who is a senior, and Harry and Hermione
#   who are freshmen. The program prints the members of the club.

class Student:
    def __init__(self, name):
        self.name = name
        self.year = "Freshman"

    def SetYear(self, y):
        self.year = y

    def Join(self, club):
        club.AddMember(self)

    def Print( self ):
        print( "%s is a %s" %(self.name, self.year))

class Club:
    def __init__(self, name):
        self.name = name
        self.members = []

    def AddMember(self, x):
        self.members.append(x)

    def Print(self):
        print(self.name)
        for x in self.members:
            print( "   ", end= "")
            x.Print()

def main():
    C = Club( "Python Coders" )
    C.AddMember( Student( "Harry" ) )
    x = Student( "Hermione" )
    x.Join( C )
    y = Student( "bob" )
    y.SetYear( "Senior" )
    y.Join(C)

    C.Print()
main()




            
        



        
    
