Safe Cracker



Goal:

Method calls - call a method passing a parameter. Your mission: use the tryCode method to crack the safe by trying all possible numbers.

Steps:

  1. Create a for loop that will repeat until the program ends.
  2. Inside the loop, call the tryCode method using the for loop variable for the code.
  3. The tryCode method will end the program when the correct code is guessed.
  4. Run the program and see all the guesses being printed to the console.
  5. Bonus: Can you change the loop so that the safe will be cracked more quickly?