Guest User

Untitled

a guest
Oct 19th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. boolean quit = false;
  2.  
  3. // Displaying Welcome Message
  4.  
  5. // displayWelcomeMessage();
  6.  
  7. // This will display the instructions on what to enter
  8. // when the user is done typing the names to sort
  9.  
  10. displayString("When you are finished entering names, enter the word, quit");
  11.  
  12. // This Do-While Loop will contain the Get String Function
  13. // It will also contain the Function that will determine which
  14. // strings qualify for the first name and last name
  15.  
  16. do
  17.  
  18. {
  19.  
  20. String newValue = getString("Please enter a name.");
  21.  
  22. // If statement to confirm if quit has been inputted to end loop
  23.  
  24. if (newValue.equalsIgnoreCase("quit"))
  25.  
  26. {
  27.  
  28. quit = true;
  29.  
  30. } // End of If Statement
  31.  
  32. displayString(newValue);
  33.  
  34. } while(quit != true);
  35.  
  36. System.out.println("This will be where it calls the Module");
  37. System.out.println("to display the first & last.");
  38.  
  39.  
  40. // Displaying GoodBye Message
  41.  
  42. // goodbyeMessage();
  43.  
  44. System.out.println("");
  45. System.out.println(msg);
  46.  
  47. System.out.println("");
  48. System.out.println(msg);
  49. String newValue = keyboard.nextLine(); //gets a the entire line as a String
  50.  
  51. // Replaces all spaces with null and checks if entered value is null
  52. if (newValue.replace(" ", "").equals(""))
  53. {
  54. System.err.println("Error: No input. Ending Program.");
  55. System.exit(-1);
  56. }
  57.  
  58. return newValue;
Add Comment
Please, Sign In to add comment