Lastinitialfirstinitialunit2ch10 | Computer Science homework help

The files must be called <>

Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.

Only submit the .java file needed to make the program run. Do not submit the .class file or any other file.


Style Components

Include properly formatted prologue, comments, indenting, and other style elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.


Topics covered in chapter

Topics with * are covered in this assignment.

*Array List class

*Storing Primitives in Array List

*Array List vs standard Array

Linked List class

List interface

Queues, Stacks, and Array Deque class

*Java Collections

Basic Requirements

Write a program that simulates rolling 2 dice and keeps track of the results.

This is similar to the previous assignment but is using Array Lists rather than regular Array’s.

 Declare an Array List of size 11 to track rolls 2-12. (an unsorted Array List)

 Ask how many rolls are to be performed

 Create 2 random numbers, each between 1 and 6 to simulate the dice

 Fill each elements in the Array List with total of the 2 dice.

 Store the number of rolls of 2 in the first element, 3 in the second, 4 in the third, etc up to 12 in the 11th element.

 Print a table showing the rolls, historical and percentage of total rolled (see



 After the table, print a total row which calculates the total rolls and the total percentage. Ensure to calculate these values and don’t just hard code based on number of rolls at the top.

 Ensure the dashed line under historical is only as long as the value below it (see example below).

o Hint: You can use the Integer wrapper class to convert the integer to a string and then determine the length of it.

 Finally, print out which roll was rolled most and how many times it was rolled. (Seem sample)

 Hint: Use the collections class to search for the max value in your arrayList

Sample output is provided below. Be sure to mimic it exactly except for the number of rolls, historical, and percentage which will change.


NOTE: Complete your activity and submit it by clicking “Submit Assignment”

Total Percentage


Sample Your output will vary based on the number of rolls entered