For loop programs

There are a lot of programs here. Do the onese that the teacher tells you to do. You can do the GREEN AND RED programs in any order. But do them before the BLUE or YELLOW ones.

Please use the names suggested below -- it makes it a lot easier to see when you've done the programs.

ForLoop1.java

Use for loops to do the following ... (all in one class)

Your output should look something like this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 ...
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 ...
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 103 106 109 112 115 ...
200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 ...
 
Enter a number (between 1 and 200):23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                                                                
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 ...
(I didn't include the numbers all the way up to 200 as it would be too long for the screen).

Multiplication.java

Write a program that accepts a number between 1 and 12 from the user, and outputs its multiplication table (up to 12).
Include a suitable heading line before the multiplication table appears.
Make the program print the results neatly (probably using printf) :
Example: the user has typed in '7' and the program prints out

	  1 times 7 = 7
	  2 times 7 = 14
	  3 times 7 = 21...

Squares.java -- omit this

Write a program that will display the squares and cubes of the numbers between -5 and 50, with an increment of 5. Your output should appear in a chart form, like this, but maybe right justified.

-5	25	-125
0	0	0
5	25	125
10	100	1000
...

Stars1.java

Start by using a for loop to just print out a row of n stars.
Then print out the number of stars in 1 row based on a number that the user enters.
Then change the program to print out a square of stars - whatever number the user enters.

Example: here the user typed in 8, so it prints an 8x8 square of stars

********
********
********
********
********
********
********
********

TableOfValues.java

Print out a table of values for an equation. Use printf for formatting (spacing and # of decimals)
x should go from -10 to +10.
Sample equation:
* You should be able to use common math functions (as in the example above)
* and also handle problems like negative roots and division by zero.

Stars2.java

X This program is too easy to find online

Print out a triangle of stars (or #). When you enter a number - e.g. 5, it should do this:

 #
 ##
 ###
 ####
 #####

Fibonacci.java

Write a program which calculates the Fibonacci series. Your program should print out the first 25 Fibonacci numbers.
(optional) Set the number of Fibbonacci numbers to print using a constant at the beginning of your program. static final int NUMFIB = 25

Pi.java **BONUS** (only if you've done the blue programs first)

Write a program that uses an infinite series to calculate PI. Stop after 100 iterations / looping 100 times. Print out the result with as many decimals as you can. How many decimal places did you get correct in 100 loops?