Fixed some typoes

This commit is contained in:
2020-06-16 22:24:05 -04:00
parent 349b831617
commit c3d0d7ded5

View File

@@ -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