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
khaled.iza
airlinereservation
Commits
fc4c08d6
Commit
fc4c08d6
authored
Nov 04, 2019
by
khale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
parents
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
158 additions
and
0 deletions
+158
-0
.classpath
.classpath
+6
-0
.project
.project
+17
-0
org.eclipse.jdt.core.prefs
.settings/org.eclipse.jdt.core.prefs
+11
-0
AirReservation.class
bin/programming01/AirReservation.class
+0
-0
AirReservation.java
src/programming01/AirReservation.java
+124
-0
No files found.
.classpath
0 → 100644
View file @
fc4c08d6
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"
/>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
</classpath>
.project
0 → 100644
View file @
fc4c08d6
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
programming01
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.eclipse.jdt.core.javanature
</nature>
</natures>
</projectDescription>
.settings/org.eclipse.jdt.core.prefs
0 → 100644
View file @
fc4c08d6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
bin/programming01/AirReservation.class
0 → 100644
View file @
fc4c08d6
File added
src/programming01/AirReservation.java
0 → 100644
View file @
fc4c08d6
package
programming01
;
import
java.util.Random
;
import
java.util.Scanner
;
public
class
AirReservation
{
// Random Int Generate
static
Random
random
=
new
Random
();
//flight number creator
static
String
FLnum
=
"FL"
+
random
.
nextInt
(
28
+
1
);
// user input scanner
static
Scanner
input
=
new
Scanner
(
System
.
in
);
public
static
void
main
(
String
[]
args
)
{
//Booking Page Start
System
.
out
.
println
(
"Press a to begin the booking process "
);
String
user
=
input
.
next
();
if
(
user
.
equals
(
"a"
))
{
customer
();
}
}
public
static
boolean
customer
()
{
// TODO Auto-generated method stub
// customer details
System
.
out
.
println
(
"Please, enter full name > "
);
String
name
=
input
.
next
();
System
.
out
.
println
(
"-----------------------------"
);
// Orgin City Input
System
.
out
.
println
(
"Please, enter where you are flying from > "
);
String
origincity
=
input
.
next
();
System
.
out
.
println
(
"-----------------------------"
);
// Destination Input
System
.
out
.
println
(
"Please, enter where you are flying to > "
);
String
destinationcity
=
input
.
next
();
System
.
out
.
println
(
"-----------------------------"
);
// Automatic FlightNumber Using RandomUtil
System
.
out
.
println
(
"Your Flight Number is > "
+
FLnum
);
System
.
out
.
println
(
"-----------------------------"
);
// Choosing Flight Class
System
.
out
.
println
(
"Please Type 1 for First Class \n"
+
"Please Type 2 for Business Class \n"
+
"Please Type 3 for Economy \n"
);
String
classChoice
=
input
.
next
();
switch
(
classChoice
)
{
case
"1"
:
addFClass
();
break
;
case
"2"
:
addBClass
();
break
;
case
"3"
:
addEClass
();
}
return
false
;
}
private
static
void
addEClass
()
{
// TODO Auto-generated method stub
System
.
out
.
println
(
"You have selected the Economy Class"
);
System
.
out
.
println
(
"-----------------------------"
);
System
.
out
.
println
(
"You will be assigned a seat automatically "
+
"Press a"
);
System
.
out
.
println
(
"----------------------"
);
String
a
=
input
.
next
();
if
(
a
.
equals
(
"a"
))
{
int
x
=
random
.
nextInt
(
90
);
int
seatnum
=
x
+
1
;
System
.
out
.
println
(
"Your seat number is "
+
seatnum
);
System
.
out
.
println
(
"-----------------------------"
);
};
}
private
static
void
addBClass
()
{
// TODO Auto-generated method stub
System
.
out
.
println
(
"You have selected the Business Class"
);
System
.
out
.
println
(
"-----------------------------"
);
System
.
out
.
println
(
"You will be assigned a seat automatically "
+
"Press a"
);
System
.
out
.
println
(
"----------------------"
);
String
a
=
input
.
next
();
if
(
a
.
equals
(
"a"
))
{
int
x
=
random
.
nextInt
(
45
);
int
seatnum
=
x
+
1
;
System
.
out
.
println
(
"Your seat number is "
+
seatnum
);
System
.
out
.
println
(
"-----------------------------"
);
};
}
private
static
void
addFClass
()
{
// TODO Auto-generated method stub
System
.
out
.
println
(
"You have selected the First Class"
);
System
.
out
.
println
(
"-----------------------------"
);
System
.
out
.
println
(
"You will be assigned a seat automatically "
+
"Press a"
);
System
.
out
.
println
(
"----------------------"
);
String
a
=
input
.
next
();
if
(
a
.
equals
(
"a"
))
{
int
x
=
random
.
nextInt
(
18
);
int
seatnum
=
x
+
1
;
System
.
out
.
println
(
"Your seat number is "
+
seatnum
);
System
.
out
.
println
(
"-----------------------------"
);
}
}
}
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