Asignment: #81 Counting Both X and Ys with a ForLoop
Code
/// Name: Sean Harrison
/// Period: 7
/// Program name: CountingByXY
/// File Name: CountingByXY.java
/// Date Finished: 2/19/2016
import java.util.Scanner;
public class CountingByXY
{
public static void main( String[] args )
{
double Number, x, y;
Number = 10;
x = 0;
y = 0;
System.out.println( " x y " );
System.out.println( "-------------" );
for ( x = -10; x <= Number; x++ )
{
y = x*x;
System.out.println( x + " " + y );
}
}
}
Picture of the output