Commit f50fe387 authored by User's avatar User

comments

parent c47eaca2
......@@ -14,79 +14,77 @@ public class reservation {
{"64", "65", "66"}, {"67", "68", "69"}, {"70", "71", "72"},
{"73", "74", "75"}, {"76", "77", "78"}, {"79", "80", "81"},
{"82", "83", "84"}, {"85", "86", "87"}, {"88", "89", "90"}};
display(plane);
}
public static void display(String plane[][]) {
int x =0;
for(int i=0; i<3; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
public static void display(String plane[][]) {//create method called "display"
for(int i=0; i<3; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
System.out.print("\t"); //print out spacing after 3 seats
}
System.out.println();
for(int i=3; i<6; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
System.out.println();//print new line
for(int i=3; i<6; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();//print new line to separate class seats
System.out.println();
System.out.println();
for(int i=6; i<9; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=6; i<9; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();
for(int i=9; i<12; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=9; i<12; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();
for(int i=12; i<15; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=12; i<15; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();//print new line to separate class seats
System.out.println();
System.out.println();
for(int i=15; i<18; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=15; i<18; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();
for(int i=18; i<21; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=18; i<21; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();
for(int i=21; i<24; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=21; i<24; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();
for(int i=24; i<27; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=24; i<27; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
System.out.println();
for(int i=27; i<30; i++) {
for(int j=0; j<3; j++) {
System.out.print("[" + plane[i][j] + "]");
for(int i=27; i<30; i++) {//for loop to print out set of seats
for(int j=0; j<3; j++) {//nested loop for each item within the 2D array
System.out.print("[" + plane[i][j] + "]"); //print out each individual seat
}
System.out.print("\t");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment