https://www.myziyuan.com/
- 金牛科技
- 因酷教育软件可以—建免费开源网校系统源代码轻松搭建在线教育平台
- 2022-01-12 10:03:12
- 免注册用户
- 2022-01-12 10:02:21
- 1264737478
- C++学生选修课程系统,#include #include #include #include using namespace std;struct Course{ string num; //课程编号 string name; //课程名称 string type; //课程性质 int period; //总学时 int classPeriod; //授课学时 int expPeriod; //实验学时或上机学时 int credit; //学分 string beginDate; //开课时间 Course *next;};void InitList (Course *&L){ L = new Course; L->next = NULL;}ostream &operator num name type period classPeriod expPeriod credit beginDate > (istream &input, Course *&c){ //cout > c->num >> c->name >> c->type >> c->period >> c->classPeriod >> c->expPeriod >> c->credit >> c->beginDate; return input;}void SaveInfo (Course *L){ Course *p = L->next; ofstream outfile ("course.txt", ios::out); if (!outfile) { cerr next; } outfile.close ();}void ReadInfo (Course *&L){ Course *r = L, *s; ifstream infile ("course.txt", ios::in); if (!infile) { cerr > s; if (!infile.eof ()) { r->next = s; r = s; } } r->next = NULL; infile.close ();}void AddInfo (Course *L){ system ("cls"); InitList (L); Course *s; s = new Course; cout > s; //cout next = L->next; L->next = s; SaveInfo (L); cout next; cout > n; while ((q != NULL) && (q->num != n)) { p = q; q = q->next; } if (q == NULL) cout next = q->next; delete q; SaveInfo (L); cout next; cout > c; bool flag = false; while (p != NULL) { if (p->credit == c) { flag = true; cout next; } if (flag == false) cout next; cout > t; bool flag = false; while (p != NULL) { if (p->type == t) { cout next; } if (flag == false) cout next; while (p != NULL) { cout next; } cout << endl << endl; system ("pause");}void Search (){ Course *l; InitList (l); while (1) { system ("cls"); cout << endl << endl << endl; cout << "\t*************************************************" << endl; cout << "\t* *" << endl; cout << "\t* 请选择查询方式 *" << endl; cout << "\t* (1)按学分查询 *" << endl; cout << "\t* (2)按性质查询 *" << endl; cout << "\t* (3) 返回 *" << endl; cout << "\t* *" << endl; cout << "\t*************************************************" << endl; switch (getch ()) { case '1': SearchByCredit (l); break; case '2': SearchByType (l); break; case '3': return; default: break; } }}void menu (){ Course *l; InitList (l); while (1) { system ("cls"); cout << endl << endl << endl; cout << "\t*****************************************************" << endl; cout << "\t* *" << endl; cout << "\t* 学生选课系统 *" << endl; cout << "\t* (1) 信息录入 *" << endl; cout << "\t* (2) 信息查询 *" << endl; cout << "\t* (3) 信息显示 *" << endl; cout << "\t* (4) 信息删除 *" << endl; cout << "\t* (0) 退出 *" << endl; cout << "\t* *" << endl; cout << "\t*****************************************************" << endl; switch (getch ()) { case '1': AddInfo (l); break; case '2': Search (); break; case '3': DispInfo (l); break; case '4': DeleteInfo (l); break; case '0': cout << "谢谢使用!" << endl; exit (0); default: break; } }}int main (){ menu (); return 0;} 学生可按要求(如总学分不得少于60)自由选课……这句话我不知道是什么意思,所以没有编选课的那段
- 2022-01-12 10:02:21