Dont know where to start on this Java Code using loops!! Help Please
Write a program to generate 100 random integers
in the range of 0 and 99999, nd the frequency count of each digit (0, 1, 2, . . . , 9) in these numbers,
and print a frequency histogram.
This is what I have so far:
import java.util.Scanner;
public class PA6 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int num;
int freq1, freq2, freq3, freq4, freq5, freq6, freq7, freq8, freq9;
int digit;
num = (int)(Math.random()*99999);
while (num > 0) {
digit = num % 10;
num = num / 10;
}
}
}
Re: Dont know where to start on this Java Code using loops!! Help Please
And what exactly does that code do? Does it compile? Does it run? What's missing from it?
Please use the highlight tags when posting code.