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
alexandru.radulescu
AirlineReservation
Commits
2b5043d2
Commit
2b5043d2
authored
Nov 01, 2019
by
LoomyGames
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some stuff, still not complete
parent
f85e03bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
10 deletions
+48
-10
Yeyey1.java
src/Yeyey1.java
+48
-10
No files found.
src/Yeyey1.java
View file @
2b5043d2
import
java.util.Scanner
;
public
class
Yeyey1
{
static
Scanner
input
=
new
Scanner
(
System
.
in
);
//We're just setting up the input for now;
static
String
[]
seat
=
new
String
[
100
];
static
int
j
=
0
,
k
=
0
,
mainSeatNumber
=
0
,
classRead
;
static
String
personName
;
static
String
destination
;
static
String
currentCity
;
static
String
[]
planeName
=
new
String
[
28
];
static
int
bookAgain
=
1
;
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
for
(
int
i
=
0
;
i
<
90
;
i
++)
{
seat
[
i
]
=
String
.
valueOf
(
i
+
1
);
...
...
@@ -18,12 +20,21 @@ public class Yeyey1 {
{
seat
[
i
]
=
"0"
+
String
.
valueOf
(
i
+
1
);
}
}
for
(
int
i
=
0
;
i
<
28
;
i
++)
{
if
(
i
<
9
)
{
planeName
[
i
]
=
"FL0"
+
(
i
+
1
);
}
else
planeName
[
i
]
=
"FL"
+
(
i
+
1
);
}
ShowSeats
();
GiveInfo
();
while
(
classRead
!=
4
)
while
(
bookAgain
==
1
)
{
System
.
out
.
println
(
"For First Class please input 1"
);
...
...
@@ -32,8 +43,13 @@ public class Yeyey1 {
classRead
=
input
.
nextInt
();
BookSeats
(
classRead
);
System
.
out
.
println
(
"Would you like to book another seat? 0 = no / 1 = yes"
);
bookAgain
=
input
.
nextInt
();
}
ShowSeats
();
if
(
bookAgain
==
0
)
{
System
.
out
.
println
(
"Have a good day!"
);
}
}
...
...
@@ -117,10 +133,32 @@ public class Yeyey1 {
public
static
void
OccupySeats
()
{
mainSeatNumber
=
input
.
nextInt
();
if
(
seat
[
mainSeatNumber
]
!=
"XX"
)
if
(
seat
[
mainSeatNumber
-
1
]
!=
"XX"
)
{
seat
[
mainSeatNumber
-
1
]
=
"XX"
;
}
else
System
.
out
.
println
(
"Seat is already occupied"
);
ShowSeats
();
}
else
{
System
.
out
.
println
(
"Seat is already occupied"
);
System
.
out
.
println
(
"Would you like to book another seat? 0 = no / 1 = yes-------"
);
bookAgain
=
input
.
nextInt
();
ShowSeats
();
}
}
public
static
void
GiveInfo
()
{
System
.
out
.
println
(
"Welcome to our online booking system"
);
System
.
out
.
print
(
"Please enter your name: "
);
personName
=
input
.
nextLine
();
System
.
out
.
print
(
"Please enter your city: "
);
currentCity
=
input
.
next
();
System
.
out
.
print
(
"Please enter your destination: "
);
destination
=
input
.
next
();
ShowSeats
();
}
}
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