Advertisement
Guest User

main

a guest
Nov 18th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package Test;
  7.  
  8. import StudentManager.Manager;
  9. import StudentManager.Student;
  10. import Validation.Validation;
  11. import java.util.ArrayList;
  12.  
  13. /**
  14. *
  15. * @author Asus
  16. */
  17. public class Main {
  18.  
  19. /**
  20. * @param args the command line arguments
  21. */
  22. public static void main(String[] args) {
  23. ArrayList<Student> ls = new ArrayList<>();
  24. Validation validation = new Validation();
  25. ls.add(new Student("1", "Pham Thai An", "Spring", "java"));
  26. ls.add(new Student("2", "Dinh Bao Long", "Summer", ".net"));
  27. ls.add(new Student("3", "Le Tuan Viet", "Spring", "c/c++"));
  28. int count = 3;
  29. //loop until user want to exit program
  30. while (true) {
  31. //Show menu option
  32. Manager.menu();
  33. int choice = validation.checkInputIntLimit(1, 5);
  34. switch (choice) {
  35. case 1:
  36. Manager.createStudent(count, ls);
  37. break;
  38. case 2:
  39. Manager.findAndSort(ls);
  40. break;
  41. case 3:
  42. Manager.updateOrDelete(count, ls);
  43. break;
  44. case 4:
  45. Manager.report(ls);
  46. break;
  47. case 5:
  48. return;
  49. }
  50.  
  51. }
  52. }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement