MCPcopy Create free account
hub / github.com/careercup/ctci / main

Method main

java/Chapter 17/Question17_11/Question.java:17–29  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

15 }
16
17 public static void main(String[] args) {
18 /* Test: call rand7 many times and inspect the results. */
19 int[] arr = new int[7];
20 int test_size = 1000000;
21 for(int k = 0; k < test_size; k++){
22 arr[rand7()]++;
23 }
24
25 for (int i = 0; i < 7; i++) {
26 double percent = 100.0 * arr[i] / test_size;
27 System.out.println(i + " appeared " + percent + "% of the time.");
28 }
29 }
30}

Callers

nothing calls this directly

Calls 1

rand7Method · 0.95

Tested by

no test coverage detected