Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. System.out.println("Would you like to play a guessing game?");
  2. response2 = myScanner.nextLine();
  3. if (response2.equalsIgnoreCase("Yes") || (response2.equalsIgnoreCase("Sure")) || (response2.equalsIgnoreCase("Yep")))
  4. {
  5. System.out.println("Im going to pick a number between 0 and 10 and you're going to try and pick it!nWhat number am I thinking of?");
  6. guess2 = myScanner.nextInt();
  7. if (guess2 == randomNum)
  8. {
  9. System.out.println("Wow! You guessed correctly!");
  10. }
  11. else
  12. {
  13. System.out.println("Nope! The number I was actually thinking about was "+randomNum+".");
  14. }
  15.  
  16. }
  17. else
  18. {
  19. System.out.println("Oh, ok. I see how it is. I'll just go cry in the corner I guess.");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement