Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
assessment part 4
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
romain.vasseur
assessment part 4
Commits
d819f5ea
Commit
d819f5ea
authored
Dec 05, 2018
by
Romain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c899adb3
Pipeline
#422
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
AssessmentPartFour.java
src/AssessmentPartFour.java
+22
-3
No files found.
src/AssessmentPartFour.java
View file @
d819f5ea
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileReader
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
public
class
AssessmentPartFour
{
List
<
String
>
morseCode
=
new
ArrayList
<
String
>();
public
int
loadMorseFromFile
(
String
filename
)
{
public
int
loadMorseFromFile
(
String
filename
)
{
int
number
=
0
;
try
(
Scanner
scanner
=
new
Scanner
(
new
File
(
filename
)))
{
// On boucle sur chaque champ détecté.
while
(
scanner
.
hasNextLine
())
{
String
line
=
scanner
.
nextLine
();
System
.
out
.
println
(
line
);
morseCode
.
add
(
line
);
// Faites ici votre traitement.
System
.
out
.
println
(
morseCode
.
size
());
number
=
morseCode
.
size
();
}
}
catch
(
FileNotFoundException
ex
)
{
System
.
out
.
println
(
"Erreur --"
+
ex
.
toString
());
}
return
0
;
return
number
;
}
...
...
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