I'm making a multiplication and here is a screenshot of what I'm trying to make:
However, I cannot get the lines to format correctly. I think I have the correct code to perform the expressions... just need help formatting the table. Is there something easy I'm missing, or do I need to restructure something?
Here is my code and below that is a screenshot of the output:
case 4:
System.out.print(" |");
for(int q=1;q<=MAX_VALUE;q++) {
System.out.printf("%4d",q);
}
System.out.println(" ");
System.out.print("----+");
for (int u=0; u<MAX_VALUE; u++) {
System.out.print("----");
}
System.out.println(" ");
for(int q=1; q<=MAX_VALUE; q++) {
System.out.printf("%3d |",q);
for (int m=1; m<=MAX_VALUE; m++) {
System.out.printf(q*m + " ");
}
}
System.out.println();
break;