Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Airline Reservation Final
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
Airline Reservation Final
Commits
a1b4ad97
Commit
a1b4ad97
authored
Nov 04, 2019
by
hayden.gooi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import random module
parent
cdc4e595
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
reservation.java
src/ar/reservation.java
+7
-5
No files found.
src/ar/reservation.java
View file @
a1b4ad97
package
ar
;
package
ar
;
import
java.util.Scanner
;
import
java.util.Scanner
;
import
java.util.Random
;
public
class
reservation
{
public
class
reservation
{
public
static
String
plane
[][]
=
{{
"XX"
,
"XX"
,
"XX"
},
{
"XX"
,
"XX"
,
"06"
},
{
"07"
,
"08"
,
"09"
},
//Initialize the array which contains the plane seats
public
static
String
plane
[][]
=
{{
"XX"
,
"XX"
,
"XX"
},
{
"XX"
,
"XX"
,
"06"
},
{
"07"
,
"08"
,
"09"
},
//Initialize 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"
},
...
@@ -11,9 +12,10 @@ public class reservation{
...
@@ -11,9 +12,10 @@ public class reservation{
{
"XX"
,
"XX"
,
"XX"
},
{
"XX"
,
"XX"
,
"XX"
},
{
"XX"
,
"71"
,
"72"
},
{
"XX"
,
"XX"
,
"XX"
},
{
"XX"
,
"XX"
,
"XX"
},
{
"XX"
,
"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"
}};
static
Random
random
=
new
Random
();
public
static
void
main
(
String
[]
args
)
{
//main subprogram
public
static
void
main
(
String
[]
args
)
{
//main subprogram
Scanner
input
=
new
Scanner
(
System
.
in
);
Scanner
input
=
new
Scanner
(
System
.
in
);
int
choice
=
0
;
String
choice
=
""
;
String
reserve
=
""
,
section
=
""
;
String
reserve
=
""
,
section
=
""
;
String
first
=
""
,
last
=
""
,
city
=
""
,
destination
=
""
;
String
first
=
""
,
last
=
""
,
city
=
""
,
destination
=
""
;
System
.
out
.
println
(
"Hello and Welcome. We first need some details-"
);
System
.
out
.
println
(
"Hello and Welcome. We first need some details-"
);
...
@@ -30,8 +32,8 @@ public class reservation{
...
@@ -30,8 +32,8 @@ public class reservation{
+
"\nPlease Type 1 for First Class"
+
"\nPlease Type 1 for First Class"
+
"\nPlease Type 2 for Business"
+
"\nPlease Type 2 for Business"
+
"\nPlease Type 3 for Economy \n"
);
+
"\nPlease Type 3 for Economy \n"
);
switch
(
choice
=
input
.
next
Int
())
{
//switch case to run different outcomes
switch
(
choice
=
input
.
next
())
{
//switch case to run different outcomes
case
1
:
//case if user chooses first class/1
case
"1"
:
//case if user chooses first class/1
section
=
"First class"
;
section
=
"First class"
;
System
.
out
.
println
(
"You have Chosen First Class"
);
//prints out the class that the user has chosen
System
.
out
.
println
(
"You have Chosen First Class"
);
//prints out the class that the user has chosen
boolean
seat
=
false
;
boolean
seat
=
false
;
...
@@ -130,10 +132,10 @@ public class reservation{
...
@@ -130,10 +132,10 @@ public class reservation{
}
}
}
}
}
}
case
2
:
//case if user chooses business class/2
case
"2"
:
//case if user chooses business class/2
System
.
out
.
println
(
"You have Chosen Business Class"
);
//prints out the class that the user has chosen
System
.
out
.
println
(
"You have Chosen Business Class"
);
//prints out the class that the user has chosen
break
;
break
;
case
3
:
//case if user chooses economy class/3
case
"3"
:
//case if user chooses economy class/3
System
.
out
.
println
(
"You have Chosen Economy Class"
);
//prints out the class that the user has chosen
System
.
out
.
println
(
"You have Chosen Economy Class"
);
//prints out the class that the user has chosen
break
;
break
;
default
:
//case if user chooses an invalid option
default
:
//case if user chooses an invalid option
...
...
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