Netbeans Question.

Netbeans Question.

Ok here is my code-

*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Random;
/**
*

*/
public class ContinueRollDie {

* @param args the command line arguments
*/
public static void main(String[] args) {
Random randomNumber = new Random();

int[][] frequency = new int[9][9];
int die1 = 0;
int die2 = 0;
for (int roll = 1; roll <= 64000; roll++) {
die1 = randomNumber.nextInt(8) + 1;
die2 = randomNumber.nextInt(8) + 1;
frequency[die1] [die2]++;
}
System.out.printf("%s%16s\n", " Sum", " Frequency");
for (int sum = 2; sum <= 12; sum++) {
System.out.printf("%4d%16d\n", sum, frequency[die1][die2]);


}


}

}

This is what I am trying to get my program to due- using a two-dimensional array to tally the actual combinations of rolls. A roll of 2 and 7 would be different than a roll of 7 and 2. The application should roll the dice 64,000 times. Display the results in a tabular format and determine if your results are reasonable.I am trying to get the application to tally the actual combination's of rolls possible within the array. I need 2 arrays.

Help plese!

View Answers









Related Tutorials/Questions & Answers:
Netbeans Question.
Netbeans Question.   Ok here is my code- * * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.Random; /** * */ public class ContinueRollDie { * @param args
Netbeans Question need help desperately!!
Netbeans Question need help desperately!!   Ok here is my code- public class RollDie2 { public static void main(String[] args) { Random randomNumber = new Random(); int[][] frequency = new int[9][9]; int die1 = 0; int
Advertisements
NetBeans
NetBeans  why Netbeans IDE is not commonly used Today by most of the companies
NetBeans
NetBeans  Hi, I am Kundan I have made a project on NetBeans. And now I want to know that how can i run my project without NetBeans IDE,on other PC. Please help me it's important
NetBeans
NetBeans  Hi, I am Kundan I have made a project on NetBeans. And now I want to know that how can i run my project without NetBeans IDE,on other PC. Please help me it's important
netbeans
netbeans  In netbeans, there are choices of books with their price. you check the book you wanted then click the purchase.the output should be the book with the price then you will get the total price of the book you purchase.how
netbeans
netbeans  guysss m nt able to opemn ma netbeans ide.. no error msg s coming... wn i installed yesterday one msg came stating about some run time error... sm one plzzzzzz hlp me
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question
Question   When there is an exception in my program how java runtime system handles
question
question  dear sir/madam my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
question
question  Dear sir i had some typing mistake at previous question so its my humble request to let me know the steps to start the tomcat6 under the tomcat directory
question
question  Gud morning sir, I have asked u some question regarding jsp in saturaday for that i didnot find any answere in which u send me the some of the links.U have asked me the specify some details. There is a entity name
Question?
Question?  My question is how to: Add a menu bar to the program with a File menu. In the File menu, add a submenu (JMenuItem) called About. When the user clicks on the About menu item, display a JOptionPane message dialog
RMI and netbeans
RMI and netbeans  how to use Rmi in netbeans? i want to connect to a server machine which is holding my application and need to identify the systems connected in LAN with it and get the IP address from it i wnt to use netbeans
java netbeans
java netbeans  i am making project in core java using Netbeans. Regarding my project i want to know that How to fetch the data from ms-access... using netbeans
java netbeans
java netbeans  i am making project in core java using Netbeans. Regarding my project i want to know that How to fetch the data from ms-access... using netbeans
Artifacts of netbeans
List of Artifacts of netbeans maven depenency
netbeans library
netbeans library  Hi could someone build a program in netbeans for a book library please.The program should provide a menu of options to work with the library, including: 1) Adding a new item to the library 2) Viewing all stock
netbeans library
netbeans library  Hi could someone build a program in netbeans for a book library please.The program should provide a menu of options to work with the library, including: 1) Adding a new item to the library 2) Viewing all stock
webservice in Netbeans
.. im using netbeans version 6.9.1 .. pls help me out... regards-- Harish Kumar
Netbeans program
Netbeans program  I need to write a program that does the following... The TicTacToe class contains a 3x3 two-dimensional array of integers... a two human player game of Tic-Tac-Toe. Using the NetBeans design tool also create
EJB with NetBeans
EJB with NetBeans  I am very new in Ejb and with very few knowledge about it. I have download NetBeans (7.01) and GlassFish (3.01). But, as I have no idea about Ejb, I am not getting how to run the code which includes a simple
netbeans program
netbeans program  Hi. could someone build this for me in netbeans please :) You are required to create a basic library management system for use with books. A Graphical User Interface (GUI) is not required, i.e. your program
RMI in netbeans 6.5
RMI in netbeans 6.5  runing client in RMI using netbeans 6.5
Netbeans GUI Ribbon
Netbeans GUI Ribbon  how to create ribbon task in java GUI using netbeans
hibernate on netbeans - Hibernate
hibernate on netbeans  is it possible for me to run the hibernate program on Netbeans IDE
JNDI names in netbeans
JNDI names in netbeans  how to create a JNDI names in netbeans
Version of netbeans>cvslib dependency
Version of netbeans>nbantext dependency
connect netbeans with oracle
connect netbeans with oracle  how to connect netbeans with oracle   Hi Friend, Please visit the following link: http://www.roseindia.net/jsf/visual-jsf.shtml Here you will find the steps to connect netbeans
"The folder name is not valid" netbeans
"The folder name is not valid" netbeans  "The folder name is not valid" while crating a jsp,html or any page in netbeans
RMI Program in netbeans
RMI Program in netbeans  pls give me an idea for how to run RMI program in netbeans with detailed example
how to install jfreechart in netbeans.
how to install jfreechart in netbeans.  I have successfully installed jfreechart in eclipse IDE.but I am unable to install the same in netbeansIDE... procedure to install it in netbeans 6.7.1 Please reply asap.Its urgent
netbeans with mysql and tomcat
netbeans with mysql and tomcat  Hi. I have to run a JSP or JAVA file in netbeans with mysql database and tomcat server 7.0. But while the page loading itself it say error. ClassNotFoundException: com.mysql.jdbc.Driver. How
NetBeans - IDE Questions
NetBeans  Can we use netbeans to create servlet, jsp pages?If yes means can you explain how it can be done? how to use netbeans for creating jsp...://www.roseindia.net/jsf/netbeans/create-jsf-application.shtml Hope that it will be helpful
struts-netbeans - Framework
struts-netbeans  hai friends please provide some help "how to execute struts programs in netbeans IDE?" is requires any software or any supporting files to execute this. thanks friends in advance
jsp netbeans javascript
jsp netbeans javascript  hi to all; I'm debutante in JSP netbeans, please help me to realize my application I have some difficulties: 1 - page... nothing is changed.) 2-how iserer date in oracle 10g database via JSP netbeans
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
java question
java question  sir, can you give me the code for online banking using netbeans and mysql in j2ee with its database connectivity
java question
java question  sir, can you give me the code for online banking using netbeans and mysql in j2ee with its database connectivity
buttons in netbeans,java
buttons in netbeans,java  respected sir, i would like to known how to make coding on a button while working on netbeans, so that a new window will open after clicking on that button? thank you   import java.awt.
Question on pooling
Question on pooling  which server supports pooling?Application server or web server
java swing in netbeans
java swing in netbeans  how can create sub menu in java swing using netbeans?   Hi Friend, Try the following code: import javax.swing.*; public class CreateSubmenu { public static void main(final String args
JSTL in Netbeans 6.9.1
JSTL in Netbeans 6.9.1  I am seeking your help in solving problem I am facing. The problem has been described below: I am using JSTL1.1 core tag... is working fine. I am using Netbeans 6.9.1 Id with Glassfish server 3 for my
java login form using netbeans
java login form using netbeans  how to connect an access database to a login form using netbeans
Linking JMenu Item with a JPane in Netbeans
Linking JMenu Item with a JPane in Netbeans  How do you link a Jpane window to a JMenu Item in Java Netbeans
This question in Jmeter
This question in Jmeter  hi..i want to send request(xml) 100 times but each time in request xml one element needs to change, otherwise request will be failed since its duplicate
Question on javascript
Question on javascript  This is not exactly what i wanted....If i enter in 2nd combobox as name of child then it should show child id in 1st combobox automatically and vice versa

Ads