From c3d0d7ded55396b2d186855bbcba433fa938630e Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Tue, 16 Jun 2020 22:24:05 -0400 Subject: [PATCH] Fixed some typoes --- .../mattrixwv/ProjectEuler/Problems/Problem17.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/mattrixwv/ProjectEuler/Problems/Problem17.java b/src/main/java/mattrixwv/ProjectEuler/Problems/Problem17.java index e0945d6..f74291c 100644 --- a/src/main/java/mattrixwv/ProjectEuler/Problems/Problem17.java +++ b/src/main/java/mattrixwv/ProjectEuler/Problems/Problem17.java @@ -42,7 +42,7 @@ public class Problem17 extends Problem{ for(int num = START_NUM;num <= STOP_NUM;++num){ //Pass the number to a function that will create a string for the number String currentNumString = getStringFromNum(num); - //Pass the string to ta function that will count the number of letters in it, ignoring whitespace and punctuation and add that number to the running tally + //Pass the string to the function that will count the number of letters in it, ignoring whitespace and punctuation and add that number to the running tally sumOfLetters += getNumberChars(currentNumString); } @@ -54,13 +54,13 @@ public class Problem17 extends Problem{ } private String getStringFromNum(int number){ String numberString = new String(); - //Starting with the largest digit create a string based on teh number passed in + //Starting with the largest digit create a string based on the number passed in //Check for negative if(number < 0){ numberString = numberString.concat("negative "); } - //Check if teh number is zero + //Check if the number is zero if(number == 0){ numberString = numberString.concat("zero"); } @@ -86,7 +86,7 @@ public class Problem17 extends Problem{ //Check for tens place if((number / 10D) >= 2D){ - //FOr the tens you need to do something special + //For the tens you need to do something special int tensPlace = (int)Math.floor(number / 10D); if(tensPlace == 9){ numberString = numberString.concat("ninety"); @@ -115,7 +115,7 @@ public class Problem17 extends Problem{ number -= (tensPlace * 10); //If there is something left in the number you will need a dash to separate the tens and ones place if(number > 0){ - numberString = numberString.concat("-"); + numberString = numberString.concat("-"); } } //Check for teens