@@ -66,15 +66,15 @@ public class AssessmentPartFour {
...
@@ -66,15 +66,15 @@ public class AssessmentPartFour {
//This is a new method that I created that takes in the string Morse
//This is a new method that I created that takes in the string Morse
publicStringMorseToEnglish(StringMorse){
publicStringMorseToEnglish(StringMorse){
//This is where I create two strings one called alpha containing the English alphabet and the other called morse which contains the morse equivalents
//This is where I create two strings one called alphabet containing the english alphabet and the other called morse which contains the morse equivalents
//This section of code creates the int i and sets it to 0. it then states that for each time i is less than morse's length increment it by one and then run the code below
//This section of code creates the int i and sets it to 0. it then states that for each time i is less than morse's length increment it by one and then run the code below
for(inti=0;i<morse.length;++i){
for(inti=0;i<morse.length;++i){
//This section of code compares the string Morse to the String morse based on the value of i
//This section of code compares the string Morse to the String morse based on the value of i
if(Morse.equals(morse[i])){
if(Morse.equals(morse[i])){
//This section of code returns the alpha value of morse if they both match
//This section of code returns the alphabet value of morse if they both match
returnalpha[i];
returnalphabet[i];
}
}
}
}
...
@@ -88,4 +88,5 @@ public class AssessmentPartFour {
...
@@ -88,4 +88,5 @@ public class AssessmentPartFour {