Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Assessment Part 2
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
jack.templeman
Assessment Part 2
Commits
48ed950f
Commit
48ed950f
authored
Nov 27, 2018
by
jackt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete Part 2.1
parent
cb987464
Pipeline
#343
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
AssessmentPartTwo.java
src/AssessmentPartTwo.java
+10
-9
No files found.
src/AssessmentPartTwo.java
View file @
48ed950f
...
@@ -19,42 +19,43 @@ public class AssessmentPartTwo {
...
@@ -19,42 +19,43 @@ public class AssessmentPartTwo {
char
aChar
=
aWord
.
charAt
(
length
);
// selects the letter at the current char placement
char
aChar
=
aWord
.
charAt
(
length
);
// selects the letter at the current char placement
Character
.
toString
(
aChar
);
// converts the char to a string value
Character
.
toString
(
aChar
);
// converts the char to a string value
Character
.
toLowerCase
(
aChar
);
// converts all inputs to lowercase to make sure they match
switch
(
String
.
valueOf
(
aChar
))
{
// switch statement to allow for loop to select the correct string and add the corresponding value
switch
(
String
.
valueOf
(
aChar
))
{
// switch statement to allow for loop to select the correct string and add the corresponding value
case
"a"
:
case
"A"
:
case
"e"
:
case
"E"
:
case
"i"
:
case
"I"
:
case
"o"
:
case
"O"
:
case
"n"
:
case
"N"
:
case
"a"
:
case
"e"
:
case
"i"
:
case
"o"
:
case
"n"
:
case
"r"
:
case
"t"
:
case
"l"
:
case
"s"
:
case
"u"
:
case
"r"
:
case
"R"
:
case
"t"
:
case
"T"
:
case
"l"
:
case
"L"
:
case
"s"
:
case
"S"
:
case
"u"
:
case
"U"
:
total
=
total
+
1
;
total
=
total
+
1
;
break
;
break
;
case
"d"
:
case
"
D"
:
case
"g"
:
case
"G
"
:
case
"d"
:
case
"
g
"
:
total
=
total
+
2
;
total
=
total
+
2
;
break
;
break
;
case
"b"
:
case
"
B"
:
case
"c"
:
case
"C"
:
case
"m"
:
case
"M"
:
case
"p"
:
case
"P
"
:
case
"b"
:
case
"
c"
:
case
"m"
:
case
"p
"
:
total
=
total
+
3
;
total
=
total
+
3
;
break
;
break
;
case
"f"
:
case
"
F"
:
case
"h"
:
case
"H"
:
case
"v"
:
case
"V"
:
case
"w"
:
case
"W"
:
case
"y"
:
case
"Y
"
:
case
"f"
:
case
"
h"
:
case
"v"
:
case
"w"
:
case
"y
"
:
total
=
total
+
4
;
total
=
total
+
4
;
break
;
break
;
case
"k"
:
case
"K"
:
case
"k"
:
total
=
total
+
5
;
total
=
total
+
5
;
break
;
break
;
case
"j"
:
case
"
J"
:
case
"x"
:
case
"X
"
:
case
"j"
:
case
"
x
"
:
total
=
total
+
8
;
total
=
total
+
8
;
break
;
break
;
case
"q"
:
case
"
Q"
:
case
"z"
:
case
"Z
"
:
case
"q"
:
case
"
z
"
:
total
=
total
+
10
;
total
=
total
+
10
;
break
;
break
;
...
...
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