Question: Develop body of the method count(String[] arr) that takes an array of strings as argument, and prints how many times each digits '1'- '9'
![Develop body of the method count(String[] arr) that takes an array of](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/64f960e3b192d_1694064866120.jpg)

Develop body of the method count(String[] arr) that takes an array of strings as argument, and prints how many times each digits '1'- '9' occurred in the strings. For example, if the method is called with following argument String[] arr = {"This is 2 of 2", "July 14", "cpsc1150"} Then the program should print: digit 1: 3 digit 2: 2 digit 4 : 1 digit 5:1 Since digit '1' occurs three times, '2' two times, '4' once, and '5' once. Read a list of words from a file (such as unsorted File.txt) and store them in a file (such as sorted List.txt) in an ascending order. To keep the problem simple, only consider words that include only alphabetical character or hyphen.
Step by Step Solution
3.45 Rating (158 Votes )
There are 3 Steps involved in it
Heres the Java code for the countString method that counts the occurrence of digits in an array of s... View full answer
Get step-by-step solutions from verified subject matter experts
