c++学生管理系统(三)

新建main.cpp

 1 #include
 2 #include "student.h"
 3
 4 using namespace std;
 5
 6 void printMenu() {
 7     cout << "**********************************" << endl;
 8     cout << "*\t0.退出" << endl;
 9     cout << "*\t1.打印学生信息" << endl;
10     cout << "*\t2.添加学生信息" << endl;
11     cout << "*\t3.通过学号查询学生信息" << endl;
12     cout << "*\t4.修改学生信息" << endl;
13     cout << "*\t5.删除学生信息" << endl;
14     cout << "*\t6.清屏" << endl;
15     cout << "**********************************" << endl;
16     cout<< "please select:" << endl;
17 }
18
19 void keyDown() {
20     Student *stu_head = NULL;
21
22     int key;
23     string sno;
24     while(1) {
25         printMenu();
26         cin >> key;
27         switch(key){
28         case 0:
29             exit(0);
30         case 1:
31             displayStudent(stu_head);
32             break;
33         case 2:
34             stu_head = addStudent(stu_head);
35             displayStudent(stu_head);
36             break;
37         case 3:
38             searchStudent(stu_head);
39             break;
40         case 4:
41             modStudent(stu_head);
42             break;
43         case 5:
44             cout << "please input student no:" << endl;
45             cin >> sno;
46             stu_head = delStudentByNo(stu_head, sno);
47             break;
48         case 6:
49             system("clear");
50             break;
51         default:
52             cout << "not expected select" << endl;
53             break;
54         }
55
56     }
57 }
58
59 int main() {
60     keyDown();
61     return 0;
62 }

Original: https://www.cnblogs.com/zhengze/p/14347976.html
Author: 斯多克
Title: c++学生管理系统(三)

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/564657/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球