class student_name: def __init__(self,student): self.student = student def student_name(self): print('Student Name: ', self.student) class Majors: def __init__(self,name1,name2): self.name1 = name1 self.name2 = name2 def major(self): pass def major2(self): print('Majors: ',self.name1, self.name2) class School: def __init__(self,school): self.school = school def school_name(self): print('School Name: ', self.school) class Student_Track: def __init__(self, School, student_name, Majors): self.School = School self.student_name = student_name self.Majors = Majors def track (self): print( 'School Name: ', School, 'Student Name: ', student_name, 'Majors: ', Majors) ob1 = student_name('bob') ob1.student_name() ob2 = Majors('l','l') ob2.major2() ob3 = School('o') ob3.school_name() ob4 = Student_Track(ob3.school_name,ob1,ob2) ob4.track()
Design a class for a Student/Major tracking system. You may use stubs for the member methods. Include a Class Diagram.I get:
"School Name: <class 'main.School'> Student Name: <class 'main.student_name'> Majors: <class 'main.Majors'>"
Student Name: bob
Majors: l l
School Name: o
in one line