下面展示一些 内联代码片
。
// A code block
var foo = 'bar';
// An highlighted block
void showMenu(string userType) {
cout << "******************************************************************************" << endl;
cout << "* 欢迎来到研究生管理系统 *" << endl;
cout << "******************************************************************************" << endl;
cout << "*用户类型: " << userType << endl;
if (userType == "Admin") {
cout << "******************************************************************************" << endl;
cout << "* 1. 教师管理 *" << endl;
cout << "* 2. 导师管理 *" << endl;
cout << "* 3. 课程管理 *" << endl;
cout << "* 4. 学生管理 *" << endl;
cout << "* 5. 退出 *" << endl;
cout << "******************************************************************************" << endl;
} else if (userType == "Teacher") {
cout << "******************************************************************************" << endl;
cout << "* 1. 查看所有教师 *" << endl;
cout << "* 2. 课程管理 *" << endl;
cout << "* 3. 查看所有学生 *" << endl;
cout << "* 4. 退出 *" << endl;
cout << "******************************************************************************" << endl;
} else if (userType == "Student") {
cout << "******************************************************************************" << endl;
cout << "* 1. 查看所有课程 *" << endl;
cout << "* 2. 查看学生信息 *" << endl;
cout << "* 3. 退出 *" << endl;
cout << "******************************************************************************" << endl;
}
}
// 教师管理功能
void teacherManagement() {
cout << "******************************************************************************" << endl;
cout << "******************************教师管理菜单************************************" << endl;
cout << "******************************************************************************" << endl;
int choice;
do {
cout << "******************************************************************************" << endl;
cout << "* 1. 添加教师 *" << endl;
cout << "* 2. 删除教师 *" << endl;
cout << "* 3. 修改教师信息 *" << endl;
cout << "* 4. 查看所有教师 *" << endl;
cout << "* 5. 返回主菜单 *" << endl;
cout << "******************************************************************************" << endl;
cout << "请输入选择: ";
cin >> choice;
switch (choice) {
case 1:
addTeacher();
break;
case 2:
removeTeacher();
break;
case 3:
updateTeacher();
break;
case 4:
viewTeachers();
break;
case 5:
cout << "返回主菜单。" << endl;
break;
default:
cout << "无效选择,请重试。" << endl;
break;
}
} while (choice != 5);
}
// 导师管理功能
void supervisorManagement() {
cout << "******************************************************************************" << endl;
cout << "* 导师管理菜单 *" << endl;
cout << "******************************************************************************" << endl;
int choice;
do {
cout << "******************************************************************************" << endl;
cout << "* 1. 添加导师 *" << endl;
cout << "* 2. 删除导师 *" << endl;
cout << "* 3. 修改导师信息 *" << endl;
cout << "* 4. 查看所有导师 *" << endl;
cout << "* 5. 返回主菜单 *" << endl;
cout << "******************************************************************************" << endl;
cout << "请输入选择: ";
cin >> choice;
switch (choice) {
case 1:
addSupervisor();
break;
case 2:
removeSupervisor();
break;
case 3:
updateSupervisor();
break;
case 4:
viewSupervisors();
break;
case 5:
cout << "返回主菜单。" << endl;
break;
default:
cout << "无效选择,请重试。" << endl;
break;
}
} while (choice != 5);
}