Advertisement
007chill

Untitled

Oct 26th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.util.Random;
  2. import java.util.Scanner;
  3. public class Question11 {
  4. public static void main(String[] args)
  5. {
  6. Scanner keyboard = new Scanner(System.in);
  7. boolean isTrue = false;
  8. String password = "happy";
  9. String correctpass=" ";
  10.  
  11.  
  12. while (!password.equals(correctpass))
  13. {
  14. System.out.println("Please enter a password: ");
  15. correctpass = keyboard.next();
  16. }
  17. System.out.println("Correct!");
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement