Assignment10.java - Assignment 10 Name Arun Das(Teaching Assistant StudentID XXXXXXXXXX Lecture T TH 12:00-1:15 PM Arizona State University CSE205

Assignment10.java - Assignment 10 Name Arun Das(Teaching...

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

// Assignment #: 10// Name: Arun Das (Teaching Assistant)// StudentID: XXXXXXXXXX// Lecture: T TH 12:00-1:15 PM// Arizona State University CSE205 Spring 2015// 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 OnceSystem.out.print("Please enter a string to add:\n");

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture