I am attempting to write a program that creates a table based on parameters given by the user that describe a graph. I am merely a beginner in Java and am just starting out, so if I am using inefficient methods then that might be the reason for that. The problem that I am encountering while writing the code is that there seems to be a strange occurrence when I run the program that causes one row to have a different spacing between columns than other rows. This is extremely infuriating and I would love to have a solution to this. Again, I am an extreme beginner and am still wrapping my mind around writing mid sized programs. T
Scanner input = new Scanner(System.in);
Scanner input2 = new Scanner(System.in);
Scanner input3 = new Scanner(System.in);
Scanner input4 = new Scanner(System.in);
Scanner input5 = new Scanner(System.in);
double xjumps;
double yjumps;
double start;
double length;
double intercept;
System.out.printf("Please input the length of your table: ");
length = input.nextDouble();
System.out.printf("\n");
System.out.printf("Please input the x-axis incrementation: ");
xjumps = input2.nextDouble();
System.out.printf("\n");
System.out.printf("Please input the y-axis incrementation: ");
yjumps = input3.nextDouble();
System.out.printf("\n");
System.out.printf("When do you want the table to start: ");
start = input4.nextDouble();
System.out.printf("\n");
System.out.printf("Please input the y intercept: ");
intercept = input5.nextDouble();
double x = start;
double y = (((start/xjumps) * yjumps) + intercept);
System.out.printf("\n");
System.out.println("X\t\t\tY");
System.out.println(x + "\t\t" + y);
for(double z = -1;z <= length;z++){
x += xjumps;
y += yjumps;
System.out.println(x + "\t\t" + y);
}