Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AirlineReservation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hayden.gooi
AirlineReservation
Commits
c47eaca2
Commit
c47eaca2
authored
Nov 02, 2019
by
User
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display seats
parent
80b618ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
4 deletions
+80
-4
reservation.java
src/airlinereservation/reservation.java
+80
-4
No files found.
src/airlinereservation/reservation.java
View file @
c47eaca2
package
airlinereservation
;
package
airlinereservation
;
import
java.util.Scanner
;
import
java.util.Scanner
;
//import scanner module
public
class
reservation
{
public
class
reservation
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
//main subprogram
Scanner
input
=
new
Scanner
(
System
.
in
);
Scanner
input
=
new
Scanner
(
System
.
in
);
String
board
[][]
=
{{
"01"
,
"02"
,
"03"
},
{
"04"
,
"05"
,
"06"
},
{
"07"
,
"08"
,
"09"
},
String
plane
[][]
=
{{
"01"
,
"02"
,
"03"
},
{
"04"
,
"05"
,
"06"
},
{
"07"
,
"08"
,
"09"
},
//initialise the array which contains the plane seats
{
"10"
,
"11"
,
"12"
},
{
"13"
,
"14"
,
"15"
},
{
"16"
,
"17"
,
"18"
},
{
"10"
,
"11"
,
"12"
},
{
"13"
,
"14"
,
"15"
},
{
"16"
,
"17"
,
"18"
},
{
"19"
,
"20"
,
"21"
},
{
"22"
,
"23"
,
"24"
},
{
"25"
,
"26"
,
"27"
},
{
"19"
,
"20"
,
"21"
},
{
"22"
,
"23"
,
"24"
},
{
"25"
,
"26"
,
"27"
},
{
"28"
,
"29"
,
"30"
},
{
"31"
,
"32"
,
"33"
},
{
"34"
,
"35"
,
"36"
},
{
"28"
,
"29"
,
"30"
},
{
"31"
,
"32"
,
"33"
},
{
"34"
,
"35"
,
"36"
},
{
"37"
,
"38"
,
"39"
},
{
"40"
,
"41"
,
"42"
},
{
"43"
,
"44"
,
"45"
},
{
"37"
,
"38"
,
"39"
},
{
"40"
,
"41"
,
"42"
},
{
"43"
,
"44"
,
"45"
},
{
"46"
,
"47"
,
"48"
},
{
"49"
,
"50"
,
"51"
},
{
"52"
,
"53"
,
"54"
},
{
"46"
,
"47"
,
"48"
},
{
"49"
,
"50"
,
"51"
},
{
"52"
,
"53"
,
"54"
},
//listing of all seat numbers
{
"55"
,
"56"
,
"57"
},
{
"58"
,
"59"
,
"60"
},
{
"61"
,
"62"
,
"63"
},
{
"55"
,
"56"
,
"57"
},
{
"58"
,
"59"
,
"60"
},
{
"61"
,
"62"
,
"63"
},
{
"64"
,
"65"
,
"66"
},
{
"67"
,
"68"
,
"69"
},
{
"70"
,
"71"
,
"72"
},
{
"64"
,
"65"
,
"66"
},
{
"67"
,
"68"
,
"69"
},
{
"70"
,
"71"
,
"72"
},
{
"73"
,
"74"
,
"75"
},
{
"76"
,
"77"
,
"78"
},
{
"79"
,
"80"
,
"81"
},
{
"73"
,
"74"
,
"75"
},
{
"76"
,
"77"
,
"78"
},
{
"79"
,
"80"
,
"81"
},
{
"82"
,
"83"
,
"84"
},
{
"85"
,
"86"
,
"87"
},
{
"88"
,
"89"
,
"90"
}};
{
"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
]
+
"]"
);
}
System
.
out
.
print
(
"\t"
);
}
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
.
print
(
"\t"
);
}
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
]
+
"]"
);
}
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
]
+
"]"
);
}
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
]
+
"]"
);
}
System
.
out
.
print
(
"\t"
);
}
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
]
+
"]"
);
}
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
]
+
"]"
);
}
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
]
+
"]"
);
}
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
]
+
"]"
);
}
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
]
+
"]"
);
}
System
.
out
.
print
(
"\t"
);
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment