Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************
- * CSCI 230 Summer 2014 *
- * @author Josh McWhorter *
- * Assignment 1 *
- ****************************/
- package csci.pkg230.assignment.pkg1;
- import java.util.*;
- public class StudentListTest {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- StudentList list = new StudentList();
- String userSelection;
- int selection;
- do {
- System.out.println("Welcome to the database menu!\n");
- System.out.println("Press 1 to insert a new record");
- System.out.println("Press 2 to delete a record");
- System.out.println("Press 3 to search the database (by last name)");
- System.out.println("Press 4 to print a range in the database");
- System.out.println("Press 5 to find the class average for a course");
- System.out.println("Press 9 to quit\n");
- userSelection = scan.nextLine();
- selection = Integer.parseInt(userSelection);
- // Intro menu
- switch (selection) {
- case 1:
- String fiNa;
- String laNa;
- String coCo;
- double coGr;
- System.out.println("What is the student's first name?");
- fiNa = scan.nextLine();
- System.out.println("What is the student's last name?");
- laNa = scan.nextLine();
- System.out.println("What is the course code?");
- coCo = scan.nextLine();
- System.out.println("What is the student's grade?");
- coGr = scan.nextDouble();
- list.insert(fiNa, laNa, coCo, coGr);
- System.out.println("Student record added.\n");
- break;
- case 2:
- System.out.println("What is the first name of the student whose record you wish to delete?\n");
- System.out.println("What is the last name of the student whose record you wish to delete?\n");
- break;
- case 3:
- System.out.println("What is the student's last name?\n");
- break;
- case 4:
- System.out.println("What is the course code for the records that you wish to print?\n");
- break;
- case 5:
- System.out.println("What is the course code for the average that you're looking to compile?\n");
- break;
- case 9:
- System.out.println("Exiting");
- break;
- default:
- System.out.println("Invalid selection.\n");
- }
- } while(selection != 9);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement