2 Replies - 2420 Views - Last Post: 30 November 2011 - 09:52 PM Rate Topic: -----

#1 tenintwenties  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 30-November 11

Java Dice Roll Homework help

Posted 30 November 2011 - 09:41 PM

Hello,
I'm working on a program for class, and it specifies that we write code that will generate 10,000 random numbers 1-6, but then we have to display a dialog that shows how many 1's appeared, how many 2's appeared, and so on. this is what i have so far:

 
public class ARG
{
		public static void main(String[] args)
		{
			int[] A = new int[10000];

			for(int i=0; i<A.length; i++)
				A[i] = 1 + (int) (6*Math.random());


			for (int i=0; i<A.length; i++)
				System.out.println(A[i]);

		

		}


}



I just need some hints at how to display the number of 1's appeared, etc. I'm a beginner java programmer so if it's possible please use detail and not too many complicated concepts because I'm only in an intro to java class. Any help will be appreciated! thank you!

Is This A Good Question/Topic? 0
  • +

Replies To: Java Dice Roll Homework help

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8332
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Java Dice Roll Homework help

Posted 30 November 2011 - 09:48 PM

You must be in the same class :)

Posted sooner this evening

http://www.dreaminco...-die-need-help/
Was This Post Helpful? 0
  • +
  • -

#3 tenintwenties  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 30-November 11

Re: Java Dice Roll Homework help

Posted 30 November 2011 - 09:52 PM

Thanks! Sorry for the repetition!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1