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
4be0feaf
Commit
4be0feaf
authored
Oct 29, 2019
by
alexandru.radulesc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified code
parent
79ef8741
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
67 deletions
+25
-67
Yeyey1.java
src/Yeyey1.java
+25
-67
No files found.
src/Yeyey1.java
View file @
4be0feaf
...
...
@@ -3,87 +3,51 @@ import java.util.Scanner;
public
class
Yeyey1
{
//--------------------------------------------------Setup Phase--------------------------------------------------\\
Scanner
input
=
new
Scanner
(
System
.
in
);
//We're just setting up the input for now;
static
int
[]
seat
=
new
int
[
100
];
static
int
j
=
0
,
k
=
0
;
public
static
void
main
(
String
[]
args
)
{
int
[]
seat
=
new
int
[
100
];
int
j
=
0
,
k
=
0
;
// TODO Auto-generated method stub
//
--------------------------------------------------Setup Phase--------------------------------------------------\\
//
TODO Auto-generated method stub
System
.
out
.
println
(
""
);
System
.
out
.
println
(
"---------------FIRST CLASS----------------"
);
System
.
out
.
println
(
""
);
//--------------------------------------------------Actual Code Phase--------------------------------------------------\\
for
(
int
i
=
0
;
i
<
18
;
i
++)
{
seat
[
i
]
=
i
+
1
;
if
(
k
<
9
)
{
if
(
j
<
3
)
{
if
(
i
<
9
)
System
.
out
.
print
(
"[0"
+
seat
[
i
]
+
"]"
);
else
System
.
out
.
print
(
"["
+
seat
[
i
]
+
"]"
);
j
++;
}
if
(
j
==
3
)
{
System
.
out
.
print
(
" "
);
j
=
0
;
}
k
++;
}
if
(
k
==
9
)
{
System
.
out
.
println
(
""
);
k
=
0
;
}
}
ShowSeats
(
0
,
18
);
System
.
out
.
println
(
""
);
System
.
out
.
println
(
"--------------BUSINESS CLASS--------------"
);
System
.
out
.
println
(
""
);
for
(
int
i
=
18
;
i
<
45
;
i
++)
{
seat
[
i
]
=
i
+
1
;
if
(
k
<
9
)
{
if
(
j
<
3
)
{
System
.
out
.
print
(
"["
+
seat
[
i
]
+
"]"
);
j
++;
}
if
(
j
==
3
)
{
System
.
out
.
print
(
" "
);
j
=
0
;
}
k
++;
}
if
(
k
==
9
)
{
System
.
out
.
println
(
""
);
k
=
0
;
}
}
ShowSeats
(
18
,
45
);
System
.
out
.
println
(
""
);
System
.
out
.
println
(
"--------------ECONOMY CLASS--------------"
);
System
.
out
.
println
(
"--------------
-
ECONOMY CLASS--------------"
);
System
.
out
.
println
(
""
);
for
(
int
i
=
45
;
i
<
90
;
i
++)
ShowSeats
(
45
,
90
);
}
public
static
void
BookSeats
(
int
classNum
)
//Method for adding the seats and displaying them
{
}
public
static
void
ShowSeats
(
int
start
,
int
finish
)
{
for
(
int
i
=
start
;
i
<
finish
;
i
++)
{
seat
[
i
]
=
i
+
1
;
if
(
k
<
9
)
{
if
(
j
<
3
)
{
System
.
out
.
print
(
"["
+
seat
[
i
]
+
"]"
);
if
(
i
<
9
)
System
.
out
.
print
(
"[0"
+
seat
[
i
]
+
"]"
);
else
System
.
out
.
print
(
"["
+
seat
[
i
]
+
"]"
);
j
++;
}
if
(
j
==
3
)
...
...
@@ -101,12 +65,6 @@ public class Yeyey1 {
}
}
}
public
void
BookSeats
(
int
classNum
)
//Method for adding the seats and displaying them
{
}
}
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