1-800-contest

This is a discussion on 1-800-contest within the C Programming forums, part of the General Programming Boards category; DEVELOPE A PHONE SPELL sample input and output: combinations: exp:1 input:1-800-2668378 output: 1-800-A-NO-TEST 1-800-A-NO-VEST 1-800-A-NO-TEST 1-800-A-ON-VEST 1-800-AM-OVERT 1-800--BOO-VEST 1-800--BOO-TEST 1-800-CONTEST ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    11

    Question 1-800-contest

    DEVELOPE A PHONE SPELL
    sample input and output:
    combinations:

    exp:1
    input:1-800-2668378
    output:
    1-800-A-NO-TEST
    1-800-A-NO-VEST
    1-800-A-NO-TEST
    1-800-A-ON-VEST
    1-800-AM-OVERT
    1-800--BOO-VEST
    1-800--BOO-TEST
    1-800-CONTEST
    1-800-CONVERT
    1-800-COO-TEST

    exp 2:
    i/p:1-800--0000000
    o/p:1-800--0000000

    exp 3:
    i/p:1-800--1000000
    o/p:1-800--1000000

    Proble:
    NOs from 2 to8 corresponds to the alphabets written like in the telphone for storing names
    given a string of input:1-800-2668378 and all possible combination of words are shown.
    for string -2668378
    hint :use a dictionary file

    1-800- is common for all strings
    if no correspond to more than one word use to saperate them
    if no has 0 or 1 put at same pos
    Last edited by tanmay_solanki; 08-27-2007 at 02:14 AM. Reason: clarifiaction

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    And what are you asking?

    See the homework policy before posting your question.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Location
    Barbados
    Posts
    31
    I think you want something to print all possible numbers(in words)
    like
    1 800 FOO BAR
    How many digits do these American numbers have?
    I am accostomed to 7 digit numbers.
    Hm...You DO realize that there will be 2^(7*3) + (2^2) combinations right?
    Or do they have to be actual words?
    I will attempt this, and post if I ever get it working.

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Out of simplicity the numbers are:

    2 = A, B, C
    3 = D, E, F
    4 = G, H, I
    5 = J, K, L
    6 = M, N, O
    7 = P, Q, R, S
    8 = T, U, V
    9 = W, X, Y, Z

    As sea_4_ever said, the combination of letters is rather large. Do the letters have to make a word?

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    11
    look the example again.
    The search will start after 1-800- from input string and from the 8th exp(2)charcter of input will use a dic.
    file to go to the (a or b or c)'s index and will start matching rest of 9th character to last searching for word.
    use - to saperate words

  6. #6
    Registered User
    Join Date
    Aug 2007
    Posts
    11
    Quote Originally Posted by sea_4_ever View Post
    I think you want something to print all possible numbers(in words)
    like
    1 800 FOO BAR
    How many digits do these American numbers have?
    I am accostomed to 7 digit numbers.
    Hm...You DO realize that there will be 2^(7*3) + (2^2) combinations right?
    Or do they have to be actual words?
    I will attempt this, and post if I ever get it working.
    look the example again.
    The search will start after 1-800- from input string and from the 8th exp(2)charcter of input will use a dic.
    file to go to the (a or b or c)'s index and will start matching rest of 9th character to last searching for word.
    use - to saperate words

  7. #7
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Seriously, if it's a contest work it out for yourself. If it's homework ask specific questions.

  8. #8
    Registered User
    Join Date
    Aug 2007
    Posts
    11
    it's not a contest.
    logic to develope a program like site www.phonespell.org in c

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,634
    Contests should be posted on the Contests Board. However, this sounds like a homework question. As stated earlier, read the homework policy and attempt it yourself first.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Design it first on paper, the actual C implementation is trivial.

    Consider, a flow chart, NS chart and an IPO chart.
    Last edited by zacs7; 08-27-2007 at 02:56 AM. Reason: Spellingz lolzez

  11. #11
    Registered User
    Join Date
    Aug 2007
    Posts
    11

    Unhappy

    need some start

  12. #12
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    Then...START !

    No one is going to that for you. People here have given you already many paths to explore...
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  13. #13
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    How about beginning with the basics of reading in a phone number, then printing out the digits which are of interest.

    If you can do that bit, then try and do the next bit which associates digits with letters.

    If not, then post what you've achieved so far and we'll take it from there.

    There's no point us explaining the details of the algorithm if just reading in the string is beyond you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  14. #14
    Registered User
    Join Date
    Aug 2007
    Posts
    11

    Unhappy

    I able to get string when one word string is present in dictionary as my result
    but could get when two saperate words correspons to my result string

  15. #15
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Well, as Salem said -- Why don't you post what you've got so far?

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Expression Evaluator Contest
    By Stack Overflow in forum Contests Board
    Replies: 20
    Last Post: 03-29-2005, 09:34 AM
  2. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 03:17 PM
  3. WANTED: Contest Master
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-23-2003, 09:15 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21