# Write a program that finds the distribution of leading digits in a set of positive integers

Hi so in my class I have to create a program that outputs this:

Let us count those leading digits...

input file name? 4BenfordLinear.txt

Digit Count Percent

1 5 11.11

2 5 11.11

3 5 11.11

4 5 11.11

5 5 11.11

6 5 11.11

7 5 11.11

8 5 11.11

9 5 11.11

Total 45 100.00

Essentially, the user inputs a textfile and the program is supposed to count the number of leading digits it has. I have no idea how to do this please help....

By: StackOverFlow - Wednesday, 7 November

# Related Posts

- New In Last 40 minutes
- Replace fixed number of symbols in String StackOverFlow (Today) - I have this number: 4200000000000000I would like to leave only the first 4 digits and last 3 digits:42000......000Everything else should be replaced by dots. How I can implement this with...
- Older News
- Java program requirement StackOverFlow (Yesterday) - Write a Java program that allows the following:1. Create an array list of 20 integers. The 20 integers are generated randomly with possible values from 0 to 10.2. Print the...
- Weka API: Obtain Pr(A=x, B=y) from a Bayesnet StackOverFlow (Yesterday) - I built a Bayesnet on an Instances object (data set) with class (label) unspecified. Suppose the Instances only has two attributes, A and B, and the dependency discovered is A->B.The...
- Java Help, greatly appreciated thanks in advance StackOverFlow (2 days ago) - Write a method that receives an ArrayList of Integers named list1 to build a new ArrayList of integers named list2. The elements of list2 should be in reverse order from...
- Removing first digit from int, but keeping leading zeros StackOverFlow (3 days ago) - I need to write code for removing the first digit if an int is more than 4 digits. For example if I have 1055 then the output would be 055....
- Scratch Card - Decimal to Octal Conversion. StackOverFlow (3 days ago) - I need help in solving this:A scratch card consists of 4 sets of 5 digits (20 digits in total) e.g. [10006-12342-00081-99993] which are printed separated by a space or a...