Results 1 to 1 of 1
- 11-18-2007, 02:13 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 7
- Rep Power
- 0
checking if there are equal numbers
how do i find out if there are equal numbers in an array of random numbers(i.e. how do i knowhow many people share birthdays in an array of random birthdays?)
public static void main (String[] args){ // main method
String groups;
String people;
int b;
int n;
int random;
people = JOptionPane.showInputDialog(" How many people do u want in a group?");
groups = JOptionPane.showInputDialog(" How many groups do u want to simulate?");
b = Integer.parseInt(people);
n = Integer.parseInt(groups);
for (int count = 0; count < n; count++){
int[] array = new int[b];
for (int i = 0; i < array.length; i++) {
random = (int)(Math.random () * 365) + 1;
array[i] = random;
}
}
}
}
Similar Threads
-
Checking of file was modified on the server
By Java Tip in forum Java TipReplies: 0Last Post: 03-02-2008, 07:18 PM -
Checking ResultSet (second approach)
By Java Tip in forum Java TipReplies: 0Last Post: 02-09-2008, 08:39 PM -
checking if there are equal numbers
By nalinda in forum New To JavaReplies: 1Last Post: 11-18-2007, 06:21 AM -
need help checking monthlyRate entry
By lowpro in forum New To JavaReplies: 1Last Post: 11-17-2007, 05:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks