from student import Student from fag import Fag from studentSystem import StudentSystem def testStudent(): student = Student("Maja") print(student.hentStudentNavn()) in1000 = Fag("IN1000") in1020 = Fag("IN1020") student.leggTilFag(in1000) print(student.hentAntallFag()) student.leggTilFag(in1020) print(student.hentAntallFag()) student.skrivUtFagPaaStudent() def testFag(): in1000 = Fag("IN1000") maja = Student("Maja") kai = Student("Kai") sofus = Student("Sofus") print(in1000.hentFagNavn()) in1000.leggTilStudent(maja) print(in1000.hentAntallStudenter()) in1000.leggTilStudent(kai) print(in1000.hentAntallStudenter()) in1000.leggTilStudent(sofus) in1000.skrivStudenterVedFag() def skrivUtStudentSystem(studentSystem): studentSystem.skrivUtInfoOmFag() studentSystem.skrivUtInfoOmStudenter() def testStudentSystem(): student = Student("Emilie") tom = Student("tom") mat1001 = Fag("MAT1001") in1000 = Fag("IN1000") studentSystem = StudentSystem() studentSystem.leggTilFag(mat1001) #studentSystem.leggTilFag(in1000) studentSystem.leggTilStudent(tom) studentSystem.leggTilStudent(student) skrivUtStudentSystem(studentSystem) studentSystem.leggTilStudentIFag(student, mat1001) studentSystem.leggTilStudentIFag(student, in1000) skrivUtStudentSystem(studentSystem) print("Fag med flest studenter: " , studentSystem.hentFagMedFlestStudenter().hentFagNavn()) print("Student som tar flest fag:", studentSystem.hentStudentMedFlestFag().hentStudentNavn()) def hovedprogram(): #testStudent() #testFag() #testStudentSystem() studentSystem = StudentSystem() studentSystem.interaktiv() hovedprogram()