Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * Creates a class to open and/or close the lock.
- *
- */
- public class OpenLock {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- System.out.println("Please enter your combination.");
- String combo1 = in.nextLine();
- String combo2 = in.nextLine();
- String combo3 = in.nextLine();
- CombinationLock myLock = new CombinationLock(combo1, combo2, combo3);
- System.out.println("Do you want to open the lock?");
- String input = in.nextLine();
- if(input.equals("Yes") || input.equals("yes")){
- System.out.println("Please enter your combination.");
- combo1 = in.nextLine();
- combo2 = in.nextLine();
- combo3 = in.nextLine();
- myLock.checkLock(combo1, combo2, combo3);
- String input2 = in.nextLine();
- if(input2.equals("Yes") || input2.equals("yes")){
- System.out.println("Please enter your combination.");
- combo1 = in.nextLine();
- combo2 = in.nextLine();
- combo3 = in.nextLine();
- myLock.checkLockAgain(combo1, combo2, combo3);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement