Requirements:
角色:学校、学员、课程、讲师要求:1. 创建北京、上海 2 所学校2. 创建linux , python , go 3个课程 , linux\py 在北京开, go 在上海开3. 课程包含,周期,价格,通过学校创建课程4. 通过学校创建班级, 班级关联课程、讲师5. 创建学员时,选择学校,关联班级5. 创建讲师角色时要关联学校,6. 提供两个角色接口6.1 学员视图, 可以注册, 交学费, 选择班级,6.2 讲师视图, 讲师可管理自己的班级, 上课时选择班级, 查看班级学员列表 , 修改所管理的学员的成绩6.3 管理视图,创建讲师, 创建班级,创建课程7. 上面的操作产生的数据都通过pickle序列化保存到文件里
First, the Process flow chart
Second, the program code
Preliminary code:
2.1 Creating a Class
Class School (object): ' 1: Feature: School = bj_oldboy_school Skill: Linux/python Object 2 : Features: School = sh_oldboy_school Skills: Go ' def __init__ (self, school_name, city_name , Teachers=none, Courses=none, Students=none, Banjis=none): ":p Aram School_name: School name:p Aram City_n Ame: City name:p Aram Teachers: Lecturer:p Aram courses: Course:p Aram Students: Student:p Aram Banjis: Class ' ' Self.school_name = school_name Self.city_name = city_name self.teschers = Teachers Self.cou RSes = Courses Self.students = Students Self.banjis = Banjis def show_info (self,attr=none): "' Show Course/instructor/Student/class: return: "Pass def get_instance (self):" ' Get object by name: RE Turn: ' Passclass Teacher: ' ' object 1: Character: name = Egon Sex = male age = 18 Skills: Select Class class to revise student scores view class student ' Def __init__ (self,teaching, name, age, sex= ' male '): ' Instructor Properties:p Aram Teaching::p Aram Name::p Aram Age::p Aram Sex: ' Pass def m Odify_score (self): "' Modify student Score: return: ' Passclass students: ' ' Object 1: Feature : name = HGz Sex = male age = 18 course = Python class = python-20 skill: Select class to register for tuition fee ' Def __init__ (Self,name,sex,age,course,banji): ' Learner Properties:p Aram Name: Learner name:p Aram Sex: Gender:p Aram Age: Ages:p Aram Course: Course:p Aram Ba Nji: Class ' Pass Def choose_course (self,course): ' Elective course:p Aram Course:: retur N: "' Passclass choose_course (object): ' 1: Feature: Course name Price skill: "Def __init__ (SELf,course,price): ' Course properties:p Aram Course: Course name:p Aram Price: Prices ' ' Pass
Python simulation Course selection system