(Explain2.java) Do Exercise 9.7 in our Thinking in Java @ Emory (free) book (TJE for short). The code is copied into the starting HWP code, and you should write your one sentence description as a comment just before the code.

(DiceRoll.java) Write an application similar to that in Lab 4-2 (DieRoll), but here generate N pairs of random int values, each from 1..6. Sum each pair and count the occurrences of each possible roll. Do this using an int array count of length 13, with count[sum] storing the number of times sum occurs, for sum in the range 2..12.

For an extra point, print out the expected values for each of these counts. You'll need to figure out the probabilities of rolling each of 2,3,...,11,12, then multiply each by N by each.

(Numbers.java) Print a table of the integers from 0 through 100, showing the decimal, octal (base 8), and hexadecimal (base 16) values for each number. Format your table like this, with each kind of value in its own column, left-justified:

1 1 1
2 2 2
...
47 57 31
...

Use StdOut.printf("fstring",value,value,value) for int value and format String fstring, study pp. 124-126 on how the format specifiers work, and note that the format specifier %d prints the value in decimal format, %o in octal, and %x in hexadecimal. Also use "t" in your format string to insert tabs within your output.

Exercise 9.7. Some programmers disagree with the general rule that vari-ables and methods should be given meaningful names. Instead, they thinkvariables and methods should be named after fruit.For each of the following methods, write one sentence that describes ab-stractly what the method does. For each variable, identify the role it plays.

1 public static int banana(int[] a) {
2 int grape = 0;
3 int i = 0;
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.