Write a program in a class CharacterFrequency that counts the number of times a digit appears in a telephone number. Your program should create an array of size 10 that will hold the count for each digit from 0 to 9. Read a telephone number from the keyboard as a string. Examine each character in the phone number and increment the appropriate count in the array. Display the contents of the array.

What will be an ideal response?


See the code in CharacterFrequency.java.

Computer Science & Information Technology

You might also like to view...

To sort on multiple fields in Datasheet view, you must move the fields, if necessary, so that they are adjacent. _________________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Describe what problem occurs in the following code. What modifications should be made to it to eliminate the problem?

``` int[] numbers = {3, 2, 3, 6, 9, 10, 12, 32, 3, 12, 6}; for (int count = 1; count <= numbers.length; count++) System.out.println(numbers[count]); ```

Computer Science & Information Technology

In function apart defined below, how many of the parameters are considered input parameters?

``` void apart(double x, int *wholep, double *fracp) { *wholep = (int)x; *fracp = x - *wholep; } ``` a. 0 b. 1 c. 2 d. 3 e. all

Computer Science & Information Technology

What two protocols are used for remote access to a server, using unencrypted and encrypted transmissions respectively?

A. AFP B. telnet C. SSH D. SNMP

Computer Science & Information Technology