Task: You are required to complete the code of the program above to satisfy the following conditions: 1. Insert your name as the author 2. Write the code to roll the dice as per the number of elements in the array. 3. Upon filling all the elements of the array, you are required to call the method getFace_YourFirstName_47> Where YourEirstName is the student first name and 47 is the 4th and 7th digit of the student's ID. 4. Your code should send the array to the method and to get the number ofevery face occurred during the rolling of the dice and output it. Also output two faces with equal frequency (if any). PS: Below is a sample output of the program and you are required to produce similar output format by completing the code above. How many times would you like to throw the dice: 100 Rolling the dice 100 times Dice with 1 point face: 16 Dice with 2 point face: 8 Dice with 3 point face: 17 Dice with 4 point face: 13 Dice with 5 point face: 17 Dice with 6 point face: 29 The faces with repeated frequency are: 3 and 5 How many times would you like to throw the dice: 250 Rolling the dice 250 times Dice with 1 point face: 41 Dice with 2 point face: 32 Dice with 3 point face: 48 Dice with 4 point face: 32 Dice with 5 point face: 52 Dice with 6 point face: 45 The faces with repeated frequency are: None

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
I want a simple coding please for beginners Fill in the blanks
Task:
You are required to complete the code of the program above to satisfy the following conditions:
1. Insert your name as the author
2. Write the code to roll the dice as per the number of elements in the array.
3. Upon filling all the elements of the array, you are required to call the method
getFace_YourFirstName_47> Where YourEirstName is the student first name and 47 is
the 4th and 7th digit of the student's ID.
4. Your code should send the array to the method and to get the number ofevery face occurred
during the rolling of the dice and output it. Also output two faces with equal frequency (if
any).
PS: Below is a sample output of the program and you are required to produce similar output
format by completing the code above.
How many times would you like to throw the dice: 100
Rolling the dice 100 times
Dice with 1 point face: 16
Dice with 2 point face: 8
Dice with 3 point face: 17
Dice with 4 point face: 13
Dice with 5 point face: 17
Dice with 6 point face: 29
The faces with repeated frequency are: 3 and 5
How many times would you like to throw the dice: 250
Rolling the dice 250 times
Dice with 1 point face: 41
Dice with 2 point face: 32
Dice with 3 point face: 48
Dice with 4 point face: 32
Dice with 5 point face: 52
Dice with 6 point face: 45
The faces with repeated frequency are: None
Transcribed Image Text:Task: You are required to complete the code of the program above to satisfy the following conditions: 1. Insert your name as the author 2. Write the code to roll the dice as per the number of elements in the array. 3. Upon filling all the elements of the array, you are required to call the method getFace_YourFirstName_47> Where YourEirstName is the student first name and 47 is the 4th and 7th digit of the student's ID. 4. Your code should send the array to the method and to get the number ofevery face occurred during the rolling of the dice and output it. Also output two faces with equal frequency (if any). PS: Below is a sample output of the program and you are required to produce similar output format by completing the code above. How many times would you like to throw the dice: 100 Rolling the dice 100 times Dice with 1 point face: 16 Dice with 2 point face: 8 Dice with 3 point face: 17 Dice with 4 point face: 13 Dice with 5 point face: 17 Dice with 6 point face: 29 The faces with repeated frequency are: 3 and 5 How many times would you like to throw the dice: 250 Rolling the dice 250 times Dice with 1 point face: 41 Dice with 2 point face: 32 Dice with 3 point face: 48 Dice with 4 point face: 32 Dice with 5 point face: 52 Dice with 6 point face: 45 The faces with repeated frequency are: None
Introduction
One of the challenges of programming is the possibility of simulating real life activities. In this
lab we are trying to simulate the throwing of dice and to test the statistics and probability. This can
be done by counting the number of times that each face of the dice appears in a certain number of
throws. The program we aiming to develop starts by prompting the user to enter the number of
throws he/she would like to roll the dice. The program should then randomly roll that dice and to
keep a record of each face for every throw.
Such requirements lend itself to the use of arrays as the natural and optimal choice. Therefore,
first step is to prompt the user of the number of throws. This, in turn, can be used to construct
the array that represent the number of choices. Furthermore, it would be more appropriate is
to throw the dice and record these throws by assigning each element on the array to the actual face
that is found.
The listing below shows the start of the program and each student is to complete the program as
per the followings requirements listed under tasks.
Simple program that simulates the rolling of a dice
a certain number. of throws.
a method that calculate the number of times each
face appearsin the rolling process
/**
The program is then call
*/
import jaxa Scaonec;
public class RallDice {
public static void main(String[] acgs) {
Scanner input = new Scanner (System.in);
Systemeuturcint("How many times would you like
int roll
int ] dice = new int [roll];
// your code here
Sxstemeutuecintla("AntoBelling_the
to throw the dice
");
inruturextint();
+roll
+" times");
// call the required method
}
public static void get_Face_YourFirstName_47 (....) {
// write the body of the method
Transcribed Image Text:Introduction One of the challenges of programming is the possibility of simulating real life activities. In this lab we are trying to simulate the throwing of dice and to test the statistics and probability. This can be done by counting the number of times that each face of the dice appears in a certain number of throws. The program we aiming to develop starts by prompting the user to enter the number of throws he/she would like to roll the dice. The program should then randomly roll that dice and to keep a record of each face for every throw. Such requirements lend itself to the use of arrays as the natural and optimal choice. Therefore, first step is to prompt the user of the number of throws. This, in turn, can be used to construct the array that represent the number of choices. Furthermore, it would be more appropriate is to throw the dice and record these throws by assigning each element on the array to the actual face that is found. The listing below shows the start of the program and each student is to complete the program as per the followings requirements listed under tasks. Simple program that simulates the rolling of a dice a certain number. of throws. a method that calculate the number of times each face appearsin the rolling process /** The program is then call */ import jaxa Scaonec; public class RallDice { public static void main(String[] acgs) { Scanner input = new Scanner (System.in); Systemeuturcint("How many times would you like int roll int ] dice = new int [roll]; // your code here Sxstemeutuecintla("AntoBelling_the to throw the dice "); inruturextint(); +roll +" times"); // call the required method } public static void get_Face_YourFirstName_47 (....) { // write the body of the method
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY