Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Part04
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
Assessment
Part04
Commits
bdbea1a8
Commit
bdbea1a8
authored
Dec 17, 2018
by
neil.whitehead
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
13:41 17/12/18
parent
c899adb3
Pipeline
#543
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
AssessmentPartFour.java
src/AssessmentPartFour.java
+48
-2
No files found.
src/AssessmentPartFour.java
View file @
bdbea1a8
import
java.util.ArrayList
;
import
java.util.List
;
import
java.io.*
;
public
class
AssessmentPartFour
{
public
class
AssessmentPartFour
{
List
<
String
>
morseCode
=
new
ArrayList
<
String
>();
public
int
loadMorseFromFile
(
String
filename
)
{
morseCode
=
new
ArrayList
<
String
>();
try
{
FileReader
file
=
new
FileReader
(
filename
);
BufferedReader
buffer
=
new
BufferedReader
(
file
);
return
0
;
String
line
=
""
;
while
((
line
=
buffer
.
readLine
())
!=
null
)
{
morseCode
.
add
(
line
);
}
//buffer.close(); not needed as try will automatically close
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"error"
);
}
System
.
out
.
println
(
filename
+
" "
+
morseCode
.
size
());
return
morseCode
.
size
();
}
public
String
translateMorse
()
{
System
.
out
.
println
(
"translate"
);
System
.
out
.
println
(
morseCode
.
size
());
System
.
out
.
println
(
morseCode
.
get
(
0
));
for
(
int
i
=
0
;
i
<
morseCode
.
size
();
i
++)
{
System
.
out
.
println
(
morseCode
.
get
(
i
));
}
return
""
;
}
...
...
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