Java Extra Credit assignments 1. Take any of the BallBox applets. Replace the calls to fillOval with a call to fillTriangle that you will write. Write a fillTriangle() method. It should have the signature private void fillTriangle(int x, int y, int side) where x and y are the position of the lower left point, and side is the length of the one of its sides in pixels. Draw a right triangle by drawing a bunch of lines one pixel apart. Use a for loop. The longest line is at the bottom, the top line is one pixel. Each line should be one smaller than the one above it. 2. Draw a chessboard with filled black and red squares. If you use your old chessboard applet, then gut the paint routine (take out the insides) First draw one square. I suggest 15 pixels on a side. Use fillRect. Now draw a row of 8 squares, with alternating colors. You will need a for loop, and move each square over (in x direction) by 15 pixels. Use an if statement to set what color to draw. Here is a routine that you can use to help decide what color to draw. private boolean isOdd(int num) { return (num % 2) == 1; } This will return true if num is odd and false if num is even. Now use a for loop to draw 8 rows. Each new row needs to be moved down (y direction) by 15 pixels.