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 cach face of the dice appears in a cecrtain 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 cach 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 nunber of times each face appears in the ralling process Author: Dr. Farid Thrahim The program is then call import java.util.Scanner; public class Rolldice { public static void main(string[] args) { Scanner input = new Scanner (System.in); System.out.print("How many times would you like to throw the dice : "); int roll - input.nextint(); int [] dice = /l your code here + System.out.println("\n\nkolling the dice new int [rol1]; roll " times")i I/ call the required method + public static void get Face YourFirstName 47 (.){ I/ write the body of the function Task: Dr. Farid Ibrahim
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 cach face of the dice appears in a cecrtain 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 cach 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 nunber of times each face appears in the ralling process Author: Dr. Farid Thrahim The program is then call import java.util.Scanner; public class Rolldice { public static void main(string[] args) { Scanner input = new Scanner (System.in); System.out.print("How many times would you like to throw the dice : "); int roll - input.nextint(); int [] dice = /l your code here + System.out.println("\n\nkolling the dice new int [rol1]; roll " times")i I/ call the required method + public static void get Face YourFirstName 47 (.){ I/ write the body of the function Task: Dr. Farid Ibrahim
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
I need the answer as soon as possible
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education