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
586ff3a3
Commit
586ff3a3
authored
Nov 03, 2019
by
User
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
class fix
output correction
parent
10fba06b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
reservation.java
src/airlinereservation/reservation.java
+18
-3
No files found.
src/airlinereservation/reservation.java
View file @
586ff3a3
...
...
@@ -98,17 +98,31 @@ public class reservation {
System
.
out
.
println
(
"Sorry there is no available seat at the moment. The next flight is in 6 hours"
);
return
;
case
"Y"
:
for
(
int
s
=
6
;
s
<
30
;
s
++)
{
for
(
int
s
=
6
;
s
<
15
;
s
++)
{
for
(
int
r
=
0
;
r
<
3
;
r
++)
{
if
(
plane
[
s
][
r
]
!=
"XX"
)
{
reserve
=
plane
[
s
][
r
];
plane
[
s
][
r
]
=
"XX"
;
section
=
"Business"
;
System
.
out
.
println
(
"Your booked seat is "
+
reserve
);
ticket
(
first
,
last
,
city
,
destination
,
section
,
reserve
);
return
;
}
}
}
for
(
int
s
=
15
;
s
<
30
;
s
++)
{
for
(
int
r
=
0
;
r
<
3
;
r
++)
{
if
(
plane
[
s
][
r
]
!=
"XX"
)
{
reserve
=
plane
[
s
][
r
];
plane
[
s
][
r
]
=
"XX"
;
section
=
"Economy"
;
System
.
out
.
println
(
"Your booked seat is "
+
reserve
);
ticket
(
first
,
last
,
city
,
destination
,
section
,
reserve
);
return
;
}
}
}
System
.
out
.
println
(
"Sorry there is no available seat in any class at the moment. The next flight is in 6 hours"
);
return
;
default
:
System
.
out
.
println
(
"invalid input please choose Y or N"
);
...
...
@@ -204,13 +218,14 @@ public class reservation {
}
public
static
void
ticket
(
String
first
,
String
last
,
String
city
,
String
destination
,
String
section
,
String
reserve
)
{
System
.
out
.
println
(
"Here are your ticket details:"
+
"|{BOARDING PASS}|"
+
"
\n
|{BOARDING PASS}|"
+
"\n Name: "
+
first
+
" "
+
last
+
"\n From: "
+
city
+
"\n To: "
+
destination
+
"\n Flight: "
+
"\n Seat No.: "
+
reserve
+
"\n Section: "
+
section
);
+
"\n Section: "
+
section
+
"\n--------------------------"
);
System
.
out
.
println
(
"Thanks for using our booking service"
);
display
(
plane
);
}
...
...
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