The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
please finish it correctly thanks :)
please finish it correctly thanks :)
please finish it correctly thanks :)
please finish it correctly thanks :)
Â
// Assignment #: 11// Name: Your name// StudentID:// Lecture:// Description: Assignment 11 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 Assignment11{public static void main (String[] args) throws IOException{char input1;String inputInfo;String line = new String();printMenu();InputStreamReader isr = new InputStreamReader(System.in);BufferedReader stdin = new BufferedReader(isr);do// will ask for user input{System.out.println("What action would you like to perform?");line = stdin.readLine();input1 = line.charAt(0);input1 = Character.toUpperCase(input1);if (line.length() == 1){// matches one of the case statementsswitch (input1){case 'P'://Enter StringSystem.out.print("Please enter a string.\n");inputInfo = stdin.readLine().trim();int result = Matching.checking(inputInfo);if (result == 0)System.out.println("Everything is matching");else if (result == 1)System.out.println("right parenthesis does not have itsmatching left parenthesis");else if (result == 2)System.out.println("left parenthesis does not have itsmatching right parenthesis");else if (result == 3)System.out.println("right brace does not have its matchingleft brace");else if (result == 4)System.out.println("left brace does not have its matchingright brace");break;case 'Q'://Quitbreak;case '?'://Display MenuprintMenu();break;default:System.out.print("Unknown action\n");break;}}
Â
Attachments:
-----------