Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Assessment4
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
benn.robinson
Assessment4
Commits
7404562d
Commit
7404562d
authored
Jan 07, 2019
by
benn.robinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update AssessmentPartFour.java
parent
2001fc96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
6 deletions
+43
-6
AssessmentPartFour.java
src/AssessmentPartFour.java
+43
-6
No files found.
src/AssessmentPartFour.java
View file @
7404562d
...
...
@@ -15,10 +15,47 @@ public class AssessmentPartFour {
public
String
translateMorse
()
{
return
""
;
}
String
output
=
""
;
String
[][]
translateMorse
=
{
{
".-"
,
"a"
},
{
"-..."
,
"b"
},
{
"-.-."
,
"c"
},
{
"-.."
,
"d"
},
{
"."
,
"e"
},
{
"..-."
,
"f"
},
{
"--."
,
"g"
},
{
"...."
,
"h"
},
{
".."
,
"i"
},
{
".---"
,
"j"
},
{
"-.-"
,
"k"
},
{
".-.."
,
"l"
},
{
"--"
,
"m"
},
{
"-."
,
"n"
},
{
"---"
,
"o"
},
{
".--."
,
"p"
},
{
"--.-"
,
"q"
},
{
".-."
,
"r"
},
{
"..."
,
"s"
},
{
"-"
,
"t"
},
{
"..-"
,
"u"
},
{
"...-"
,
"v"
},
{
".--"
,
"w"
},
{
"-..-"
,
"x"
},
{
"-.--"
,
"y"
},
{
"--.."
,
"z"
},
{
"/"
,
" "
}};
}
for
(
String
morse
:
morseCode
)
{
for
(
int
i
=
0
;
i
<
translateMorse
.
length
;
i
++)
{
if
(
morse
.
equals
(
translateMorse
[
i
][
0
]))
{
output
=
output
+
translateMorse
[
i
][
1
];
break
;
}
}
}
morseCode
.
clear
();
return
output
;
}
}
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