Skip to content

Commit

Permalink
feat: homework complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Mar 20, 2024
1 parent 83dc480 commit d338c0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/me/alex4386/gachon/sw14462/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.*;

public class Main {
public static String currentTarget = "";
public static String currentTarget = "day06";
public static boolean fallbackToLatest = true;

public static Map<String, Class<?>> getAvailableTargetClassNames() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public boolean add(int value) throws IllegalArgumentException {
throw new IllegalArgumentException("Grade must be between 0 and 100");
}

boolean isValid = super.add(value);
if (isValid) {
boolean isTerminated = super.add(value);
if (!isTerminated) {
switch (value / 10) {
case 10:
case 9:
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/me/alex4386/gachon/sw14462/day06/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ public static void exercise3_2b() {
System.out.print("Enter the score: ");
int score = getScanner().nextInt();

stats.add(score);
try {
stats.add(score);
} catch (IllegalArgumentException e) {
System.err.println(e.getMessage());
}
}

System.out.println("total count: "+stats.getCount());
Expand Down

0 comments on commit d338c0f

Please sign in to comment.