SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 314 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 22 Dec 2017 My Price 10.00

performs the chosen task. It will keep asking a user

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 statements
               switch (input1)
                {
                 case 'P':   //Enter String
                   System.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 its matching left parenthesis");
                   else if (result == 2)
                        System.out.println("left parenthesis does not have its matching right parenthesis");
                   else if (result == 3)
                        System.out.println("right brace does not have its matching left brace");
                   else if (result == 4)
                        System.out.println("left brace does not have its matching right brace");
                   break;
                 case 'Q':   //Quit
                   break;
                 case '?':   //Display Menu
                   printMenu();
                   break;
                 default:
                   System.out.print("Unknown action\n");
                   break;
                }
              }
             else
              {
               System.out.print("Unknown action\n");
              }
            } while (input1 != 'Q' || line.length() != 1);
       }


      /** The method printMenu displays the menu to a user**/
      public static void printMenu()
       {
         System.out.print("Choice\t\tAction\n" +
                            "------\t\t------\n" +
                            "P\t\tEnter String\n" +
                            "Q\t\tQuit\n" +
                            "?\t\tDisplay Help\n\n");
      }
    }

Attachments:

Answers

(5)
Status NEW Posted 22 Dec 2017 12:12 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)