MCPcopy Create free account
hub / github.com/Berkeley-CS61B/skeleton-sp23 / erroringMethod

Method erroringMethod

lab05/src/puzzle/Puzzle.java:60–70  ·  view source on GitHub ↗
(Random r)

Source from the content-addressed store, hash-verified

58 }
59
60 private static void erroringMethod(Random r) {
61 String s = null;
62 System.out.println("""
63 Hmm, what is the value of `guessThis` when the out-of-bounds exception is thrown?
64 Replace the first line of `answer.txt` accordingly.
65 Hint: Use an exception breakpoint.""");
66 while (r.nextInt(100) != 10) {
67 guessThis += r.nextInt();
68 s = LOTS_OF_STRINGS[r.nextInt(LOTS_OF_STRINGS.length + 1)];
69 }
70 }
71
72 public static void main(String[] args) {
73 puzzle();

Callers 1

puzzleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected