Guest User

Untitled

a guest
Dec 11th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include "studentList.h"
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  9. SetConsoleTextAttribute(hConsole, 15);
  10. int input;
  11. int IDnum;
  12. studentList list;
  13. list.add(student(700, "Shirley Ether", "Pan American"));
  14. list.add(student(300, "Zapata Patas", "Pan American"));
  15. list.add(student(600, "Ismael Zapata", "Pan American"));
  16. list.add(student(150, "Big Bobbaboush", "Pan American"));
  17. list.add(student(750, "Waffle Shoes", "Pan American"));
  18. list.add(student(800, "Slippy Frog", "Pan American"));
  19. list.add(student(110, "Audra Whale", "Pan American"));
  20. list.add(student(70, "Pancake Mix", "Pan American"));
  21.  
  22. while(true)
  23. {
  24. list.selection();
  25. SetConsoleTextAttribute(hConsole, 14);
  26. cout << endl << "Please make a selection: ";
  27. cin >>input;
  28. SetConsoleTextAttribute(hConsole, 15);
  29. cout << endl;
  30. if(input == 1)
  31. list.display();
  32. else if(input == 2)
  33. list.sort("id");
  34. else if(input == 3)
  35. list.sort("name");
  36. else if(input == 4)
  37. {
  38. list.display();
  39. SetConsoleTextAttribute(hConsole, 14);
  40. cout << endl << "Please enter the ID of the student you wish to remove: ";
  41. cin >> IDnum;
  42. SetConsoleTextAttribute(hConsole, 15);
  43. list.removeStudent(IDnum);
  44. }
  45. else if(input == 5)
  46. {
  47. SetConsoleTextAttribute(hConsole, 14);
  48. cout << "Please enter the ID of the student to retrieve their information: ";
  49. cin >> IDnum;
  50. SetConsoleTextAttribute(hConsole, 15);
  51. list.getStudent(IDnum);
  52. }
  53. else if(input == 6)
  54. break;
  55. }
  56.  
  57. return 0;
  58. }
Add Comment
Please, Sign In to add comment