Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by chris ( 14 years ago )
import java.until.Scanner;

public class combinationLock
    {
      boolean islocked = true;
      String lockAnswer;
      string imputGuesses;
      string combinationTries;
      Scanner in =new Scanner (system.in);
      
      public combinationLock(string newAnswer)
      {
       answer = newAnswer;   
      }
     
      public void imputGuesses()
      {
       system.out.println("Enter An Answer Or Fear The Wrath Of.....Skeletor. Answer in the form of three letters,it doesnt matter what case, as long as it is letters it will work");
       imputGuesses = in.next();
       combinationTries = imputGusses.substring(imputGuesses.length() -3,imputGuesses.length());
       
          
      }
      
      public void checkTheGuesses();
      {
       isLocked = !solution.equalsIgnoreCase(imputGuesses);
       if (isLocked == true)
       {
           system.out.println("sorry, now you will feel the wrath of skeletor. Also the lock is locked and you failed");
           //watch for dramatic effect: http://www.youtube.com/watch?v=AT3XVnKcl2Y
       }
      }
      else if (isLocked == false)
      {
       system.out.println("well it looks like you dont have to face my wrath. The lock is now unlocked.");   
      }
    }
}

 

Revise this Paste

Your Name: Code Language: