Assignment10 - Assignment 10 Name ZhenQian StudentID 1208334266 Lab Lecture 10:30 am Tue Th Arizona State University CSE205 Description The Assignment

Assignment10 - Assignment 10 Name ZhenQian StudentID...

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

// Assignment #: 10// Name: ZhenQian// StudentID: 1208334266// Lab Lecture: 10:30 am Tue Th// Arizona State University CSE205// Description: The Assignment 10 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.*;public class Assignment10{public static void main(String[] args){char input1;String inputInfo = new String();int operation2;String line = new String();//create a linked list to be used in this method.LinkedList list1 = new LinkedList();try{// print out the menuprintMenu();// create a BufferedReader object to read input from a keyboardInputStreamReader isr = new InputStreamReader (System.in);BufferedReader stdin = new BufferedReader (isr);do{System.out.print("What action would you like to perform?\n");line = stdin.readLine().trim(); //read a lineinput1 = line.charAt(0);input1 = Character.toUpperCase(input1);if (line.length() == 1) //check if a user entered only one character{switch (input1){case 'A': //Add String Once

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture