Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import java.util.Scanner;
  2. /**
  3. * Creates a class to open and/or close the lock.
  4. *
  5. */
  6. public class OpenLock {
  7. public static void main(String[] args) {
  8. Scanner in = new Scanner(System.in);
  9.  
  10. System.out.println("Please enter your combination.");
  11. String combo1 = in.nextLine();
  12. String combo2 = in.nextLine();
  13. String combo3 = in.nextLine();
  14.  
  15. CombinationLock myLock = new CombinationLock(combo1, combo2, combo3);
  16.  
  17. System.out.println("Do you want to open the lock?");
  18. String input = in.nextLine();
  19. if(input.equals("Yes") || input.equals("yes")){
  20. System.out.println("Please enter your combination.");
  21.  
  22.  
  23. combo1 = in.nextLine();
  24. combo2 = in.nextLine();
  25. combo3 = in.nextLine();
  26.  
  27. myLock.checkLock(combo1, combo2, combo3);
  28.  
  29.  
  30.  
  31. String input2 = in.nextLine();
  32. if(input2.equals("Yes") || input2.equals("yes")){
  33. System.out.println("Please enter your combination.");
  34. combo1 = in.nextLine();
  35. combo2 = in.nextLine();
  36. combo3 = in.nextLine();
  37. myLock.checkLockAgain(combo1, combo2, combo3);
  38.  
  39. }
  40.  
  41.  
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement