Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 2:
- System.out.println("---Buy Stocks---");
- System.out.println("Please enter the symbol of the stock you would like to buy");
- s= input.nextLine();
- System.out.println("You Entered: "+ s);
- boolean b = false;
- do{
- try{
- System.out.println("is this correct");
- Scanner n = new Scanner(System.in);
- boolean bn = n.nextBoolean();
- if(bn == true)
- { System.out.println("okay your purchase has been added to your portfolio");}
- else if(bn == false){
- System.out.println("ok let's start over");
- }
- } catch (InputMismatchException e) {
- System.out.println("Invalid Input!");
- }
- } while (!b);
Add Comment
Please, Sign In to add comment