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
thomas.barraclough
AirlineReservation
Commits
1a42f6d2
Commit
1a42f6d2
authored
Nov 03, 2019
by
Tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First Upload
parents
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
176 additions
and
0 deletions
+176
-0
.classpath
Airplan_project/.classpath
+6
-0
.gitignore
Airplan_project/.gitignore
+1
-0
.project
Airplan_project/.project
+17
-0
org.eclipse.jdt.core.prefs
Airplan_project/.settings/org.eclipse.jdt.core.prefs
+11
-0
Airplane_class.java
Airplan_project/src/Airplane_class.java
+113
-0
test.java
Airplan_project/src/test.java
+28
-0
No files found.
Airplan_project/.classpath
0 → 100644
View file @
1a42f6d2
<?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>
Airplan_project/.gitignore
0 → 100644
View file @
1a42f6d2
/bin/
Airplan_project/.project
0 → 100644
View file @
1a42f6d2
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
Airplan_project
</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>
Airplan_project/.settings/org.eclipse.jdt.core.prefs
0 → 100644
View file @
1a42f6d2
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
Airplan_project/src/Airplane_class.java
0 → 100644
View file @
1a42f6d2
import
java.util.Scanner
;
public
class
Airplane_class
{
public
static
Scanner
input
=
new
Scanner
(
System
.
in
);
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
//Here I am initialising the variables needed to obtain the customers information
String
name
;
String
origin
;
String
destination
;
Integer
FL
=
00
;
//this is for a yes or no question for when deciding to pick a seat or get one selected for you
String
yesOrNo
;
//This int is initialised here and will later allow the user to enter a specific to number to proceed with the program
int
next
;
//Here I have initialised and int which I will use for a switch command
int
sector
=
0
;
//this int is for choosing a seat
int
seat
;
//Here I start a loop so that I can transfer the user back to here when needed
while
(
true
)
{
//This increments the value of the flight number by 1 every time the user returns to this screen, for example
// it will start of as FL01 and then when you come back to this code it will be FL02, then FL03 and so on.
FL
=
FL
+
01
;
//This prints out a line on the screen, \n's are used to create blank lines, this makes a line of space
//which makes the application easier to read and more professional, I later use this to clear the screen of text.
System
.
out
.
print
(
"Thank you for flying with us today!\n\nplease enter your name, origin city and destination city\n\nName > "
);
//This line of code allows the user to input their name this, the application then remembers this for further use
name
=
input
.
next
();
//This prints a sentence to the screen
System
.
out
.
print
(
"Origin City > "
);
//Here I allow the user to input their origin city
origin
=
input
.
next
();
//This prints a sentence to the screen
System
.
out
.
print
(
"Destination City > "
);
//The following line allows the user to enter the destination city of the flight
destination
=
input
.
next
();
//This prints a sentence to the screen as well as including previous data we collected to display on screen
System
.
out
.
print
(
"\n"
+
name
+
"'s flight to "
+
destination
+
" is on flight FL"
+
FL
+
"\n\n"
);
System
.
out
.
print
(
"Please type 1 to continue to the next section > "
);
//Here I allow the user to input the number 1 to make the continue, I did this to give the user time to read
//what was displayed on screen
next
=
input
.
nextInt
();
//The line below looks at what the user input and if it is corresponding to "1" the code inside of the if statement initialises
if
(
next
==
1
)
{
//This prints a sentence to the screen
System
.
out
.
print
(
"\n\n\n\n\n\n\n\nPlease choose what section you would like to be seated in!\n"
+
"Please type 1 for First Class\n"
+
"Please type 2 for Business\n"
+
"Please type 3 for Economy\n\n"
);
//This line of code allows the user to pick a number from 3
sector
=
input
.
nextInt
();
//I used a switch statement to select a case corresponding to the users input, this was needed to select an item
//from the section list
switch
(
sector
)
{
}
}
//A reference to the switch statement created earlier, I did this externally to the main code because it makes the code
//easier to understand
switch
(
sector
)
{
//Here is my first case, used for the first class. If the user typed in 1 earlier this code would run.
case
1
:
//This prints a sentence to the screen
System
.
out
.
println
(
"\n\n\n\n\n\nYou have chosen First Class\n"
);
System
.
out
.
println
(
"Would you like to choose a seat? type y for yes or n for no "
);
yesOrNo
=
input
.
next
();
if
(
yesOrNo
.
equals
(
"y"
))
{
System
.
out
.
println
(
"Please select a seat between 1-18, enter then number of the seat you would like\n"
);
seat
=
input
.
nextInt
();
System
.
out
.
println
(
"You chose seat number "
+
seat
+
"!"
);
}
if
(
yesOrNo
.
equals
(
"n"
))
{
System
.
out
.
println
(
"you chose no"
);
}
//This ends the block of code used in the case
break
;
//My second case is for the business section of the plane
case
2
:
System
.
out
.
println
(
"\\n\\n\\n\\n\\n\\nYou have chosen Business"
);
break
;
//This case is used for the economy section of the plane
case
3
:
System
.
out
.
println
(
"\n\n\n\n\n\nYou have chosen Economy"
);
break
;
}
}
}
}
\ No newline at end of file
Airplan_project/src/test.java
0 → 100644
View file @
1a42f6d2
import
java.util.Scanner
;
public
class
test
{
public
static
Scanner
input
=
new
Scanner
(
System
.
in
);
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
int
day
;
day
=
input
.
nextInt
();
switch
(
day
)
{
}
switch
(
day
)
{
case
1
:
System
.
out
.
println
(
"Monddsd"
);
break
;
case
2
:
System
.
out
.
println
(
"Msdsdsdsdsddsd"
);
break
;
}}}
\ No newline at end of file
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