Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. /****************************
  2. * CSCI 230 Summer 2014 *
  3. * @author Josh McWhorter *
  4. * Assignment 1 *
  5. ****************************/
  6.  
  7. package csci.pkg230.assignment.pkg1;
  8. import java.util.*;
  9.  
  10. public class StudentListTest {
  11. public static void main(String[] args) {
  12. Scanner scan = new Scanner(System.in);
  13. StudentList list = new StudentList();
  14. String userSelection;
  15. int selection;
  16.  
  17. do {
  18.  
  19. System.out.println("Welcome to the database menu!\n");
  20. System.out.println("Press 1 to insert a new record");
  21. System.out.println("Press 2 to delete a record");
  22. System.out.println("Press 3 to search the database (by last name)");
  23. System.out.println("Press 4 to print a range in the database");
  24. System.out.println("Press 5 to find the class average for a course");
  25. System.out.println("Press 9 to quit\n");
  26. userSelection = scan.nextLine();
  27. selection = Integer.parseInt(userSelection);
  28.  
  29. // Intro menu
  30. switch (selection) {
  31. case 1:
  32. String fiNa;
  33. String laNa;
  34. String coCo;
  35. double coGr;
  36.  
  37. System.out.println("What is the student's first name?");
  38. fiNa = scan.nextLine();
  39. System.out.println("What is the student's last name?");
  40. laNa = scan.nextLine();
  41. System.out.println("What is the course code?");
  42. coCo = scan.nextLine();
  43. System.out.println("What is the student's grade?");
  44. coGr = scan.nextDouble();
  45.  
  46. list.insert(fiNa, laNa, coCo, coGr);
  47. System.out.println("Student record added.\n");
  48. break;
  49. case 2:
  50. System.out.println("What is the first name of the student whose record you wish to delete?\n");
  51. System.out.println("What is the last name of the student whose record you wish to delete?\n");
  52. break;
  53. case 3:
  54. System.out.println("What is the student's last name?\n");
  55. break;
  56. case 4:
  57. System.out.println("What is the course code for the records that you wish to print?\n");
  58. break;
  59. case 5:
  60. System.out.println("What is the course code for the average that you're looking to compile?\n");
  61. break;
  62. case 9:
  63. System.out.println("Exiting");
  64. break;
  65. default:
  66. System.out.println("Invalid selection.\n");
  67. }
  68. } while(selection != 9);
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement