minor changes

This commit is contained in:
SowinskiBraeden committed 2025-01-28 11:26:09 -08:00
1 parent b2230558db
commit 1cb6bc133e
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ public class Distance {
x2 = scan.nextDouble();
System.out.print("Enter y2 coord: ");
y2 = scan.nextDouble();
scan.close();
double distance = Math.sqrt(Math.pow((x2 - x1), 2)
+3 -1
View File
@@ -34,8 +34,10 @@ public class FunWithStrings {
// Very clean code here -- checkstyle
int len = trimmedBook.length();
String upperFirst = trimmedBook.substring(0, 1).toUpperCase();
String middleLow = trimmedBook.substring(1, len - 1);
String middleLow = trimmedBook.substring(1, len - 1).toLowerCase();
String upperLast = trimmedBook.substring(len - 1, len).toUpperCase();
System.out.printf("Finally: %s\n", upperFirst + middleLow + upperLast);
// scan.next() returns the next token
}
}