Lastinitialfirstinitialunit2ch10 | Computer Science homework help

The files must be called <LastInitialFirstInitialUnit2Ch10.java>

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.

5%

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.

5%

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.

LiFiUnit2Ch10.java

 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

90%

sample).

 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.

10%

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

Total Percentage

100%

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

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.
×

Contact Us on WhatsApp

× How can I help you?