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
jordan.perrin
AirlineReservation
Commits
4dc18bf8
Commit
4dc18bf8
authored
Nov 03, 2019
by
Jordan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
array time
parent
c68cdefd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
AirlineReservation.java
AirlineReservation/src/AirlineReservation.java
+25
-2
No files found.
AirlineReservation/src/AirlineReservation.java
View file @
4dc18bf8
...
...
@@ -4,7 +4,6 @@ import java.util.Random;
public
class
AirlineReservation
{
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
// Write an application to assign seats on each flight of the airplane.
// Each flight has 90 seats.
...
...
@@ -80,6 +79,29 @@ public class AirlineReservation {
}
int
[][]
seats
=
new
int
[
9
][
10
];
int
seatno
=
0
;
for
(
int
i
=
0
;
i
<
9
;
i
++)
for
(
int
j
=
0
;
j
<
10
;
j
++)
{
seats
[
i
][
j
]=
seatno
;
seatno
++;
if
(
seatno
<=
9
)
{
System
.
out
.
print
(
"["
+
0
+
seatno
+
"]"
+
" "
+
""
+
" "
);
}
else
if
(
seatno
<=
18
)
{
System
.
out
.
print
(
"["
+
seatno
+
"]"
+
" "
);
}
}
// Display a seating chart using an array, using a 9x10 chart.
// After a seat is assigned, replace the seat number with XX in the array.
...
...
@@ -110,5 +132,6 @@ public class AirlineReservation {
}
}
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