main.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. This is a test project.
  3. */
  4. #include <iostream>
  5. #include <cstdlib>
  6. #include "src/student.h"
  7. #include "src/show.h"
  8. #include "src/student.cpp"
  9. #include "src/show.cpp"
  10. int main(void) {
  11. using namespace std;
  12. int choice, i = 1;
  13. char *id;
  14. show studentshow;
  15. while (i) {
  16. cout << endl;
  17. cout << "欢迎使用猫学籍管理系统 Alpha!" << endl;
  18. cout << "本程序采用 WTFPL 自由软件许可证开源。" << endl;
  19. cout << " - - - " << endl;
  20. cout << " [ 1 ] 新建学生数据 " << endl;
  21. cout << " [ 2 ] 修改学生数据 " << endl;
  22. cout << " [ 3 ] 查询学生数据 " << endl;
  23. cout << " [ 4 ] 删除学生数据 " << endl;
  24. cout << " [ 5 ] 输出所有数据 " << endl;
  25. cout << " [ 6 ] 关于该系统 " << endl;
  26. cout << " [ 7 ] 退出该系统 " << endl;
  27. cout << " - - - " << endl;
  28. cout << "请选择您的操作: ";
  29. cin >> choice;
  30. switch (choice) {
  31. case 1:
  32. studentshow.setdata();
  33. break;
  34. case 2:
  35. cout << "请输入您要修改的学生学号:";
  36. cin >> id;
  37. studentshow.changedata(id);
  38. break;
  39. case 3:
  40. cout << "请输入您要查询的学生学号:";
  41. cin >> id;
  42. studentshow.inquirynum(id);
  43. break;
  44. case 4:
  45. cout << "请输入您要删除的学生学号:";
  46. cin >> id;
  47. studentshow.deletedata(id);
  48. break;
  49. case 5:
  50. studentshow.pulldata();
  51. break;
  52. case 6:
  53. cout << "本程序采用 WTFPL 协议并开源,详情请看 README 文件。" << endl;
  54. cout << "如遇到 BUG,请汇报给开发者。" << endl;
  55. break;
  56. case 7:
  57. i = 0;
  58. }
  59. }
  60. return 0;
  61. }