Guest User

Untitled

a guest
Oct 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. case 2:
  2.  
  3.  
  4. System.out.println("---Buy Stocks---");
  5.  
  6. System.out.println("Please enter the symbol of the stock you would like to buy");
  7.  
  8. s= input.nextLine();
  9. System.out.println("You Entered: "+ s);
  10. boolean b = false;
  11.  
  12. do{
  13. try{
  14. System.out.println("is this correct");
  15. Scanner n = new Scanner(System.in);
  16. boolean bn = n.nextBoolean();
  17.  
  18. if(bn == true)
  19. { System.out.println("okay your purchase has been added to your portfolio");}
  20. else if(bn == false){
  21. System.out.println("ok let's start over");
  22. }
  23. } catch (InputMismatchException e) {
  24. System.out.println("Invalid Input!");
  25. }
  26. } while (!b);
Add Comment
Please, Sign In to add comment