Commit abc9a5be authored by Romain's avatar Romain

update

parent d819f5ea
Pipeline #423 canceled with stages
...@@ -9,12 +9,16 @@ import java.util.Scanner; ...@@ -9,12 +9,16 @@ import java.util.Scanner;
public class AssessmentPartFour { public class AssessmentPartFour {
List<String> morseCode = new ArrayList<String>();
public int loadMorseFromFile(String filename) { public int loadMorseFromFile(String filename) {
int number=0; int number=0;
List<String> morseCode = new ArrayList<String>();
try (Scanner scanner = new Scanner(new File(filename))) { try (Scanner scanner = new Scanner(new File(filename))) {
// On boucle sur chaque champ détecté. // On boucle sur chaque champ détecté.
number=0;
while (scanner.hasNextLine()) { while (scanner.hasNextLine()) {
String line = scanner.nextLine(); String line = scanner.nextLine();
System.out.println(line); System.out.println(line);
...@@ -22,6 +26,7 @@ public class AssessmentPartFour { ...@@ -22,6 +26,7 @@ public class AssessmentPartFour {
// Faites ici votre traitement. // Faites ici votre traitement.
System.out.println(morseCode.size()); System.out.println(morseCode.size());
number=morseCode.size(); number=morseCode.size();
} }
} catch (FileNotFoundException ex) { } catch (FileNotFoundException ex) {
System.out.println("Erreur --" + ex.toString()); System.out.println("Erreur --" + ex.toString());
...@@ -34,6 +39,9 @@ public class AssessmentPartFour { ...@@ -34,6 +39,9 @@ public class AssessmentPartFour {
public String translateMorse() public String translateMorse()
{ {
return ""; return "";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment