Assignment #83: Xs and Ys

Code

public class XSquared {

    public static void main (String[] args) {
        
        double y;
    
        System.out.println("x \t y");
    
        for (double x = -10; x <= 10; x = x + 0.5) {
        
            y = (x * x);
            System.out.println(x + "\t" + y);
            
        }
        
    }
    
}
    

Picture of the output