Please complete this homework before next class. I will be posting the
solutions after next class.
Problem set A
1. Write a function called "printTwice()" that prints the string that you give it
twice. You should be able to use it like this :
printTwice("Hello");
And it should print
HelloHello
2. Write a program that draws circles at the mouse position. Now make it so
that the color of the circle changes over time. This one is hard,
it will require some creative problem solving.
3. Write a program that prints all the even numbers between 0 and 9999
4. Write a program where there is a circle in the center of the screen. Make it so
that you can move
it by pressing W, A, S, D. W should move the circle up,
D should move the circle right. S should move the circle down.
And A should move the circle right.
Problem set B
1. Create a class called "Position" that has two members, an integer x and an integer y.
2. Create an array of 50 Positions. Use a loop to fill them with random positions.
3. In the draw function, use a loop to draw circles at the 50 positions.
Problem set C
1. Create an ArrayList that can store integers.
2. Fill the ArrayList with 100 random numbers.
3. Print out all the numbers in the list.
Problem set D
1. Create a 2D array of integers that is 5 by 5.
2. In the array, set the second element in the second array to be 135.
3. Create a 2D array of integers that is 50 by 50.
4. Write a 2D loop that sets all of the integers in the array to be random.