Where would you declare the value of a variable in a method? For example, on slide #14, where would you put, for example, num = 4. Would you put it before the if-else statement, or after?
In slide #14, we are creating a method that tests if a number is even. In this method, we pass in a number such as 4 as the parameter INTO our isEven method. An example of a complete program using the function is here: https://repl.it/@AKumar/isEvenExample.
In slide #14, we are creating a method that tests if a number is even. In this method, we pass in a number such as 4 as the parameter INTO our isEven method. An example of a complete program using the function is here: https://repl.it/@AKumar/isEvenExample.