Hello!
I was given the following problem:
Define the function f(x; y) as:
f(x,y) = sqrt(x^2-y^2)
Write a program that produces a table of f(x, y) for integers x and y from 0 to n where
y <= x. The value of f(x,y) appears in row (x+1), column (y +1) of the table. The number
of rows in the table is determined by the user. Format the table so that the columns align
and decimal points align. (You may assume that the table has at most fifty rows.) For
instance, a table with fifteen rows looks like:
0.0
1.0 0.0
2.0 1.7 0.0
3.0 2.8 2.2 0.0
4.0 3.9 3.5 2.6 0.0
5.0 4.9 4.6 4.0 3.0 0.0
6.0 5.9 5.7 5.2 4.5 3.3 0.0
7.0 6.9 6.7 6.3 5.7 4.9 3.6 0.0
8.0 7.9 7.7 7.4 6.9 6.2 5.3 3.9 0.0
9.0 8.9 8.8 8.5 8.1 7.5 6.7 5.7 4.1 0.0
10.0 9.9 9.8 9.5 9.2 8.7 8.0 7.1 6.0 4.4 0.0
11.0 11.0 10.8 10.6 10.2 9.8 9.2 8.5 7.5 6.3 4.6 0.0
12.0 12.0 11.8 11.6 11.3 10.9 10.4 9.7 8.9 7.9 6.6 4.8 0.0
13.0 13.0 12.8 12.6 12.4 12.0 11.5 11.0 10.2 9.4 8.3 6.9 5.0 0.0
14.0 14.0 13.9 13.7 13.4 13.1 12.6 12.1 11.5 10.7 9.8 8.7 7.2 5.2 0.0
I know that I have to use functions, and I also know that I have to use nested for loops to get/print out the values of x and y. Could I get just a hint of what the next step is (in terms of setting up the loops)? Any input would be greatly appreciated!