public class Main {
public static void main(String[] args) {
calculateValues(-10, 10, 1);
}
public static void calculateValues(int start, int end, int step) {
System.out.printf("%4s %4s %4s%n", "a", "x", "y");
for (int a = start; a <= end; a += step) {
int x = calculateX(a);
double y = calculateY(a);
System.out.printf("%4d %4d %4.2f%n", a, x, y);
}
}
public static int calculateX(int a) {
return a * a;
}
public static double calculateY(int a) {
return Math.sqrt(a);
}
}