Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CharacterSorter {
  4. public static void main(String[] args){
  5.  
  6. System.out.println("Welcome to Character Sorter Program");
  7. System.out.println("Please input a string to be sorted");
  8.  
  9. Scanner scanner = new Scanner(System.in);
  10. int character = scanner.nextInt();
  11.  
  12. boolean exit = false;
  13. while (!exit) {
  14. System.out.println("Please select the option you would like to see");
  15. System.out.println("");
  16. System.out.println("1. Display character frequencies alphabetically");
  17. System.out.println("2. Display sorted frequencies");
  18. System.out.println("3. Show types of character frequencies");
  19. System.out.println("4. Exit");
  20.  
  21. int select = scanner.nextInt();
  22. if (select > 4 && select < 0){
  23. System.out.println("Error, bad input, please enter a number 1-4");
  24. }
  25.  
  26. if (select == 1){
  27.  
  28. }
  29. if (select == 2){
  30.  
  31. }
  32. if (select == 3){
  33.  
  34. }
  35. if (select == 4){
  36. System.out.println("Character Sorter Exited Successfully");
  37. exit = true;
  38. }
  39. }
  40. }
  41. }
  42.  
  43. \
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement