Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Kattis - T9 Spelling - C Language I need an expert to work out the code for the problem described below for me please. Thanks!

Kattis - T9 Spelling - C Language

I need an expert to work out the code for the problem described below for me please. Thanks!

image text in transcribed

T9 Spelling The Latin alphabet contains 26 characters and telephones only have ten digits on the keypad. We would like to make it easier to write a message to your friend using a sequence of keypresses to indicate the desired characters. The letters are mapped onto the digits as shown below. To insert the character 'B' for instance, the program would press 22". In order to insert two characters in sequence from the same key, the user must pause before pressing the key a second time. The space charactershould be printed to indicate a pause. For example, "2 2" indicates "AA" whereas "22" indicates "B". DEF 7 PORS tuV WAYZ Figure 1: Phone keypad Input The first line of input gives the number of cases, N,1 N 100. N test cases follow. Each case is a line of text containing the desired message, which will be at most 1000 characters long. Each message will consist of only lowercase characters 'a'-'z' and space characters.Pressing zero emits a space Output For each test case, output one line containing "Case #x"followed by the message translated into the sequence of key presses Sample Input 1 Sample Output 1 Case #1: 44 444 Case #2: 999337777 Case #3: 333666 6660 022 2777 Case #4: 443 3555 555666096667775553 4 yes foo bar hello world

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago

Question

Write a note on Quality circles.

Answered: 1 week ago

Question

Describe how to measure the quality of work life.

Answered: 1 week ago

Question

Know how to use reservations systems to inventory demand.

Answered: 1 week ago