Homework 4


Problem Set A

Write a function called multiply that takes in an integer x and returns x times 100.
Test it in the setup function.

Write a function called printHello that prints hello. It takes no parameters and
returns nothing.

What is a function's return type? What is the return type of the println function?

What is a parameter?

Write a function that takes in an integer x. The function should print
the word "hi" x number of times. It should be called printXTimes.

Write a function called alwaysTrue that always returns true. It takes no parameters.

Problem Set B

Create an array containing the first 100 positive integers.
Use a loop to do this.

Create an array of Strings containing "A", "B", and "C"

Using your array that contains the first 100 positive integers, write
code that prints every other element in the array. Use a loop for this