# Tutor profile: Priscilla L.

## Questions

### Subject: Javascript Programming

function test(input) { console.log(input+10); } What gets printed out when test(10) is called? What about test("hello")? Why is this allowed?

test(10) prints "20". test("hello") prints "hello10". This is because Javascript is an untyped language. It doesn't compile statically or check types.

### Subject: Java Programming

Compute the factorial of some number. Given n of 1 or more, return the factorial of n, which is n * (n-1) * (n-2) ... 1.

public static int factorial(int n) { if (n==1) { return 1; } else return n*factorial(n-1); }

### Subject: Computer Science (General)

Using Java, write a method that accomplishes the following: Given an array of integers, return the maximum value. Assume that the array is non-empty.

public static int max(int[] numbers) { int max = numbers[0]; for (int i = 0; i < numbers.length; i++) { int num = numbers[i]; if (num > max) { max = num; } } return max; }

## Contact tutor

needs and Priscilla will reply soon.