Methods 2 - parameters


examples


Classwork

1.  Write a method products that takes an int and prints that number times each of the numbers from 1 to 10

2. Write a method guesser that takes a string secretWord and an int limit. Give the user limit tries to guess the secret word and either congratulate them if they guess in time or tell them they failed if they take too many guesses

3. In a main method, show the products of 17 and of 58, and make the user guess "swordfish" in 23 tries and "password" in 3 tries.