Le Jingle
2012-10-29 00:06:26
One of our assignments was to make a box in the debug..
Would this be effective? I'd think it's okay, given this is all we've covered in the class, but are there things that I've overlooked, things that I've not covered (ex would be things that help the code that wouldn't be at the level of code or below) that anyone suggests?
Basically, anything that's more advanced, what is it (or at least what's it called)? Just lookin' to learn :cool:
Will also edit in another problem I'm working on, about building a debug rocket ship :cool: x2
Would this be effective? I'd think it's okay, given this is all we've covered in the class, but are there things that I've overlooked, things that I've not covered (ex would be things that help the code that wouldn't be at the level of code or below) that anyone suggests?
public class Boxes {
private final static int SIZE = 6; // Prints a 6x6 hollow box
public static void main(String[] args) {
boxProblem();
}
public static void boxProblem() {
for (int row = 1; row <= SIZE; row++) {
if (row == 1) {
for (int ii = 1; ii <= SIZE; ii++) {
System.out.print("*");
}
System.out.println();
} else if ((row > 1) && (row < SIZE)) {
for (int col = 1; col <= SIZE; col++) {
if (col == 1) {
System.out.print("*");
} else if ((col > 1) && (col < SIZE)) {
System.out.print(" ");
} else if (col == SIZE) {
System.out.println("*");
}
}
} else if (row == SIZE) {
for (int ii = 1; ii <= SIZE; ii++) {
System.out.print("*");
}
System.out.println();
}
}
}
}Basically, anything that's more advanced, what is it (or at least what's it called)? Just lookin' to learn :cool:
Will also edit in another problem I'm working on, about building a debug rocket ship :cool: x2