Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. String[] array1 = {"A","B","C","D"};
  2. String pick = "";
  3.  
  4. for(int a=0; a<array1.length; a++)
  5. {
  6. System.out.print("n Pick an exception: ");
  7. System.out.print("n A. Arithmetic Exception");
  8. System.out.print("n B. Array Out Of Bounds Exception");
  9. System.out.print("n C. Array Store Exception");
  10. System.out.print("n D. Number Format Exception");
  11. System.out.print("nnPick: ");
  12. pick = br.readLine();
  13. pick = array1[a]
  14.  
  15. if(array1[a].equalsIgnoreCase ("a"))
  16. {
  17. //output1;
  18. }
  19.  
  20. else if(array1[a].equalsIgnoreCase ("b"))
  21. {
  22. //output2;
  23. }
  24. else if(array1[a].equalsIgnoreCase ("c"))
  25. {
  26. ////output3;
  27. }
  28. else if(array1[a].equalsIgnoreCase ("d"))
  29. {
  30. //output4;
  31. }
  32.  
  33.  
  34. // PS If anyone can also let me know how I can display the user input depending to the sequence it was selected what would be great!
  35.  
  36. System.out.print("nn Status: " +array1[a] + "nn ");
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement