Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Working Project
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
dan.foskett
Working Project
Commits
d1489dbe
Commit
d1489dbe
authored
Nov 15, 2020
by
dan.foskett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial comment
parents
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
133 additions
and
0 deletions
+133
-0
.classpath
Assignment-One.git.first/.classpath
+10
-0
.gitignore
Assignment-One.git.first/.gitignore
+1
-0
.project
Assignment-One.git.first/.project
+17
-0
org.eclipse.jdt.core.prefs
...gnment-One.git.first/.settings/org.eclipse.jdt.core.prefs
+14
-0
Menu.java
Assignment-One.git.first/src/Menu.java
+27
-0
Seats.java
Assignment-One.git.first/src/Seats.java
+46
-0
test.java
Assignment-One.git.first/src/test.java
+18
-0
No files found.
Assignment-One.git.first/.classpath
0 → 100644
View file @
d1489dbe
<?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-14"
>
<attributes>
<attribute
name=
"module"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
</classpath>
Assignment-One.git.first/.gitignore
0 → 100644
View file @
d1489dbe
/bin/
Assignment-One.git.first/.project
0 → 100644
View file @
d1489dbe
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
Assignment-One.git.first
</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>
Assignment-One.git.first/.settings/org.eclipse.jdt.core.prefs
0 → 100644
View file @
d1489dbe
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=14
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=14
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.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=14
Assignment-One.git.first/src/Menu.java
0 → 100644
View file @
d1489dbe
import
java.util.Scanner
;
public
class
Menu
{
static
String
menu
[]
=
{
""
,
"Code 01 Pizza 10"
,
"Code 02 Steak 7"
,
"Code 03 Sandwich 5"
,
"Code 04 Water 1"
,
"Code 05 Soft drink 2"
,
"Code 06 Tea 2"
,
"Code 07 Coffee 2"
,
"Code 08 Ice cream 2"
,
"Code 09 Chocolate 2"
};
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
System
.
out
.
println
(
"This is our Menu."
);
for
(
int
i
=
1
;
i
<
9
;
i
++)
{
System
.
out
.
println
(
"["
+
menu
[
i
]
+
"] "
);
}
Scanner
myObj
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Please type the item you want."
);
String
order
=
myObj
.
nextLine
();
// Reads the user input
System
.
out
.
println
(
"The item you wish to be is "
+
order
);
System
.
out
.
println
(
"Please type PAY to pay for your order."
);
String
pay
=
myObj
.
nextLine
();
// Reads the user input
System
.
out
.
println
(
"Thank you for booking with us, your seat and order is now done."
);
}
}
Assignment-One.git.first/src/Seats.java
0 → 100644
View file @
d1489dbe
import
java.util.Scanner
;
public
class
Seats
{
static
String
seat
[]
=
{
""
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"11"
,
"12"
,
"13"
,
"14"
,
"15"
,
"16"
,
"17"
,
"18"
,
"19"
,
"20"
,
"21"
,
"22"
,
"23"
,
"24"
,
"25"
,
"26"
,
"27"
,
"28"
,
"29"
,
"30"
,
"31"
,
"32"
,
"33"
,
"34"
,
"35"
,
"36"
,
"37"
,
"38"
,
"39"
,
"40"
,
"41"
,
"42"
};
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
for
(
int
i
=
1
;
i
<
43
;
i
++)
{
if
(
i
==
7
||
i
==
21
||
i
==
35
||
i
==
42
)
{
System
.
out
.
println
(
"["
+
seat
[
i
]
+
"] "
);
}
else
if
(
i
==
14
||
i
==
28
)
{
System
.
out
.
println
(
"["
+
seat
[
i
]
+
"] "
);
System
.
out
.
println
(
""
);
}
else
{
System
.
out
.
print
(
"["
+
seat
[
i
]
+
"] "
);
}
}
Scanner
myObj
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Please enter the seat(s) you wish to book."
);
// Asks the user to input the seat they want.
int
choiceseat
=
Integer
.
parseInt
(
myObj
.
nextLine
());
// Converts the input into a string.
seat
[
choiceseat
]
=
"XX"
;
// Replaces their seat with "XX"
//Printing the table again with their choice crossed out.
for
(
int
i
=
1
;
i
<
43
;
i
++)
{
if
(
i
==
7
||
i
==
21
||
i
==
35
||
i
==
42
)
{
System
.
out
.
println
(
"["
+
seat
[
i
]
+
"] "
);
}
else
if
(
i
==
14
||
i
==
28
)
{
System
.
out
.
println
(
"["
+
seat
[
i
]
+
"] "
);
System
.
out
.
println
(
""
);
}
else
{
System
.
out
.
print
(
"["
+
seat
[
i
]
+
"] "
);
}
}
System
.
out
.
println
(
"The seat you have booked is "
+
choiceseat
+
"."
);
}
}
\ No newline at end of file
Assignment-One.git.first/src/test.java
0 → 100644
View file @
d1489dbe
import
java.util.Scanner
;
public
class
test
{
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
Scanner
myObj
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Hello and welcome to our resturant. Please enter your name to continue."
);
String
userName
=
myObj
.
nextLine
();
// Reads the user input
System
.
out
.
println
(
"your username is "
+
userName
);
Seats
.
main
(
args
);
// Calling Seats class
Menu
.
main
(
args
);
// Calling Menu class
}
}
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