Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1: Telephone Number Generator Standard telephone keypads contain the digits 0 through 9. The numbers 2 through 9 each have 3 letters associated with

image text in transcribed

Exercise 1: Telephone Number Generator Standard telephone keypads contain the digits 0 through 9. The numbers 2 through 9 each have 3 letters associated with them, as is indicated by the following table: Digit LetterDigit Letter ABC DEF GHI UKL MNO PORS TUV WXYZ 6 4 5 8 9 Companies use seven letter words as a memory mnemonic for consumers of their products. For example, a seven letter word like NUMBERS would translate to 686-2377. Unfortunately, your company recently upgraded their telephone system and it cannot handle words for telephone numbers. They need a program to translate their old phone business directory which consists of seven letter words into their numeric representation. The nave approach is to use an if statement or a switch statement for comparisons. An optimized approach would explore any ype ofmathematical relationships between the values or use another programming structure to perform the same task as an if statement, but in less statements. Write a program to convert the existing phone directory into their new phone directory. That is, convert each seven letter word into its numeric equivalent based upon the chart above. The file to use for input is oldPhone.txt and the new file should be called newPhone.txt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

4. Who should be invited to attend?

Answered: 1 week ago

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago