On some basic cell phones, text messages can be sent using the numeric keypad. Because each key has multiple letters associated with it, multiple key presses are needed for most letters. Pressing the number once generates the first character listed for that key. Pressing the number 2, 3, 4 or 5 times generates the second, third, fourth or fifth character. Key Symbols 1 .,?!: 2 АВС 3 DEF 4 GHI JKL MNO 7 PQRS 8. TUV 9. WXYZ Space Write a program that displays the key presses needed for a message entered by the user. Construct a dictionary that maps from each letter or symbol to the key presses needed to generate it. Then use the dictionary to create and display the presses needed for the user's message. Sample Input Hello, World! Sample Output 4433555555666110966677755531111

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 12RQ
icon
Related questions
Question

Write a python program for this question.

On some basic cell phones, text messages can be sent using the numeric keypad.
Because each key has multiple letters associated with it, multiple key presses are
needed for most letters. Pressing the number once generates the first character listed
for that key. Pressing the number 2, 3, 4 or 5 times generates the second, third, fourth
or fifth character.
Key
Symbols
1
.,?!:
АВС
3
DEF
4
GHI
JKL
MNO
7
PQRS
8
TUV
9.
WXYZ
Space
Write a program that displays the key presses needed for a message entered by the user.
Construct a dictionary that maps from each letter or symbol to the key presses needed to
generate it. Then use the dictionary to create and display the presses needed for the user's
message.
Sample Input
Hello, World!
Sample Output
4433555555666110966677755531111
Transcribed Image Text:On some basic cell phones, text messages can be sent using the numeric keypad. Because each key has multiple letters associated with it, multiple key presses are needed for most letters. Pressing the number once generates the first character listed for that key. Pressing the number 2, 3, 4 or 5 times generates the second, third, fourth or fifth character. Key Symbols 1 .,?!: АВС 3 DEF 4 GHI JKL MNO 7 PQRS 8 TUV 9. WXYZ Space Write a program that displays the key presses needed for a message entered by the user. Construct a dictionary that maps from each letter or symbol to the key presses needed to generate it. Then use the dictionary to create and display the presses needed for the user's message. Sample Input Hello, World! Sample Output 4433555555666110966677755531111
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage