Assignment5.java - Assignment Name StudentID Lecture...

This preview shows page 1 - 2 out of 2 pages.

// Assignment #: 5 // Name: Luis Hopkins // StudentID: 1213343688 // Lecture: 10:45 // Description: The Assignment 5 class displays a menu of choices to a user // and performs the chosen task. It will keep asking a user to // enter the next choice until the choice of 'Q' (Quit) is // entered. import java.io.*; //to use InputStreamReader and BufferedReader import java.util.*; //to use ArrayList public class Assignment5 { static Employee newemp; public static void main (String[] args) { // ArrayList object is used to store Employee objects ArrayList<Employee> employeeList = new ArrayList<Employee>(); try { printMenu(); // print out menu // create a BufferedReader object to read input from a keyboard InputStreamReader isr = new InputStreamReader (System.in); BufferedReader stdin = new BufferedReader (isr); String line, inputInfo; boolean operation = false; char input1; do { System.out.println("What action would you like to perform?"); line = stdin.readLine().trim(); input1 = line.charAt(0); input1 = Character.toUpperCase(input1); if (line.length() == 1) { switch (input1) { case 'A': //Add Employee System.out.print("Please enter some employee information to

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture