Use Eclipse for Java.
Write a method countStairs that, given a number of blocks, counts and returns the number of stairs you could build with the blocks. Stairs are built in a staircase with one block for the first step, two for the second step, three for the third step, and so on, like this picture which shows * for each block in a staircase:
*
**
***
If you had 5 blocks, you could only build 2 stairs (which requires 1+2 = 3 blocks) and not 3 stairs (which would require 1+2+3 = 6 blocks).
Hint: Use a loop which counts up to calculate the total number of blocks needed for successive steps until you surpass the number of blocks given. You may only use two if statements.