Write a program in a class Character Frequency that counts the number of times a digit appears in a telephone number.


Problem 1: In checkwriting systems, it’s crucial to prevent alteration of check amounts. One common security method requires that the amount be written in numbers and spelled out in words as well. Even if someone can alter the numerical amount of the check, it’s tough to change the amount in words. Create a
dictionary that maps numbers to their corresponding word equivalents. Write a script that inputs a numeric check amount that’s less than 1000 and uses the dictionary to write the word equivalent of the amount. For example, the amount 112.43 should be written as:

ONE HUNDRED TWELVE AND 43/100
Problem 2: Standard telephone keypads contain the digits zero through nine. The numbers two through nine each have three letters associated with them, as shown in the following table:
Many people find it difficult to memorize phone numbers, so they use the correspondence between digits and letters to develop sevenletter words (or phrases) that correspond to their phone numbers. For example,
a person whose telephone number is 6862377 might use the correspondence indicated in the preceding table to develop the seven letter word “NUMBERS.” Every sevenletter word or phrase corresponds to
exactly one sevendigit telephone number. A budding data science entrepreneur might like to reserve the phone number 2443282 (“BIG DATA”).

Every sevendigit phone number without 0s or 1s corresponds to many different sevenletter words, but most of these words represent unrecognizable gibberish. A veterinarian with the phone number 7382273
would be pleased to know that the number corresponds to the letters “PET CARE.”

Write a script that, given a sevendigit number, generates every possible sevenletter word combination corresponding to that number. There are 2,187 (37) such combinations. Avoid phone numbers with the digits 0 and 1 (to which no letters correspond). See if your phone number corresponds to meaningful words.

Problem 3: Write a program in a class Character Frequency 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.