Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7619773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:46:21+00:00 2026-05-31T03:46:21+00:00

A mobile phone has 12 keys for input, (‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’,

  • 0

A mobile phone has 12 keys for input, (‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘0’, ‘*’ and ‘#’).

In standard text input mode each key can be used to input the letters of the alphabet and the space character. For example, to access the letter ‘b’ the user would press the ‘2’ key twice.

It takes a user a minimum of 100 ms to press a key. If a user has to use the same key to input consecutive characters there must be at least a 0.5 second pause for the phone to accept that the next key press represents a new character.

I want to write an console application which accepts any string that can be entered using the key assignments in the grid using C#. The application should accept input from a user and calculate the minimum time required for the user to input that string using the key pad and the sequence of keys that would be required.

If somebody know who can help me to write program.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:46:22+00:00Added an answer on May 31, 2026 at 3:46 am

    This should give you an idea:

    class Mobilegrid
    {
        const int MIN_DURATION = 100;
        const int WAIT_DURATION = 500;
    
        private static Dictionary<Char, Tuple<Char, int>> Grid;
        static Mobilegrid()
        {
            Grid = new Dictionary<Char, Tuple<Char, int>>();
            Grid.Add('a', Tuple.Create('2', 1));
            Grid.Add('b', Tuple.Create('2', 2));
            Grid.Add('c', Tuple.Create('2', 3));
            Grid.Add('d', Tuple.Create('3', 1));
            Grid.Add('e', Tuple.Create('3', 2));
            Grid.Add('f', Tuple.Create('3', 3));
            Grid.Add('g', Tuple.Create('4', 1));
            Grid.Add('h', Tuple.Create('4', 2));
            Grid.Add('i', Tuple.Create('4', 3));
            Grid.Add('j', Tuple.Create('5', 1));
            Grid.Add('k', Tuple.Create('5', 2));
            Grid.Add('l', Tuple.Create('5', 3));
            Grid.Add('m', Tuple.Create('6', 1));
            Grid.Add('n', Tuple.Create('6', 2));
            Grid.Add('o', Tuple.Create('6', 3));
            Grid.Add('p', Tuple.Create('7', 1));
            Grid.Add('q', Tuple.Create('7', 2));
            Grid.Add('r', Tuple.Create('7', 3));
            Grid.Add('s', Tuple.Create('7', 4));
            Grid.Add('t', Tuple.Create('8', 1));
            Grid.Add('u', Tuple.Create('8', 2));
            Grid.Add('v', Tuple.Create('8', 3));
            Grid.Add('w', Tuple.Create('9', 1));
            Grid.Add('x', Tuple.Create('9', 2));
            Grid.Add('y', Tuple.Create('9', 3));
            Grid.Add('z', Tuple.Create('9', 4));
        }
    
        public static int CalculateMinimumTime(String word)
        {
            int totalMillis = 0;
            for (int index = 0; index < word.Length; index++)
            {
                Tuple<Char, int> charInfo = Grid[word[index]];
                int Pos = charInfo.Item2;
                int clickTime = Pos * MIN_DURATION;
                if (index != 0)
                {
                    Tuple<Char, int> lastCharInfo = Grid[word[index - 1]];
                    if (lastCharInfo.Item1 == charInfo.Item1)
                        clickTime += WAIT_DURATION;
                }
                totalMillis += clickTime;
            }
            return totalMillis;
        }
    }
    

    Then you’d get the total minimum required time:

    int totalMillis = Mobilegrid.CalculateMinimumTime("hello"); //1800
    

    Note: you have to add special chars like white-space.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you have a Windows Mobile 6.0 phone that also has a GPS receiver.
I have an application which communicates with mobile phone gate. User has to send
Mobile phones are like radios which listen/broadcast on their bands. A mobile phone can
I have this code that sends a text message to your mobile phone... $text
I have a device which has got 9 keys just like an ordinary mobile
I'm trying to build a Trie but on a mobile phone which has very
I use my mobile phone for connection to the internet on my laptop, I
With all the different mobile phone browsers and the mobile market being so diverse
I'm considering taking mobile phone software development course at my university. The course uses
I purchased MicroMax A60 mobile phone which was not provided with any PC suite.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.