Current location: Hot Scripts Forums » Programming Languages » C/C++ » Telephone Word Generator


Telephone Word Generator

Reply
  #1 (permalink)  
Old 09-07-05, 09:54 AM
necro_mancer's Avatar
necro_mancer necro_mancer is offline
New Member
 
Join Date: Sep 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Telephone Word Generator

im kindly new here, and i have this kind of problem to create the programming. here is the problem:

Many people find it difficult to memorize phone numbers, so they use the correspondence between digits and letters to develop eight-letter (i want to use 8 letters and 8 numbers) words that correspond to their phone numbers.

For example, a person whose telephone number is 4263-7663 might use the correspondence to develop the eight-letter word “HANDSOME” so that people can easily remember his phone number. Each eight-letter word corresponds to exactly one eight-digit telephone number. A delivery service could surely do so with the number 3354-8379 stands for “DELIVERY”.

Each eight-digit phone number corresponds to many separate eight-letter words. Here is other example:

46774825 - HOSPITAL
26397467 - BODYSHOP
73743368 - RESIDENT
24276464 - CHARMING
42637663 - HANDSOME

here is the table on how i get the number generate into word:

2 = ABC
3 = DEF
4 = GHI
5 = JKL
6 = MNO
7 = PRS
8 = TUV
9 = WXY

Notes:
- the program can be key in the word then the output is a number or key in the number and the output is words.
- the words must be 8 character and contains 8 number only(see example)
- for your info, the character is not include Q and Z. And the number not include 0 and 1
- if there any question, please tell me..i need it before friday..please
Reply With Quote
  #2 (permalink)  
Old 09-07-05, 10:44 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
to make this program function correctly and produce words that are meaningful is almost impossible AFAIK..
it's not that C/C++ can't do it! it's the logic behind it that lacks..
think of a program that could tell if the produced word makes sense or not!
your example 42637663 - HANDSOME might be produced as: IAODSMN which still represents the number!
to make the computer produce some meaningful words requires the program to have millions of words to check against, a dicitionary to be precise.
so imagine the program producing the word IAODSMN and then checking it against the dictionary and then when it doesn't find a match , changes a letter and re-check!
and the possibilties that can be found from an 8 chars word each slot (char) may have one of 3 chars is ALOT ... really ALOT.. I can't remember the formula to find the number of posibilties but I know it's not a small number at all

this is rather an interesting problem! so allow me to move this topic to "The Lounge" where it might get more attention..

if anyone has anything else to add, please do!
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 09-07-05, 12:59 PM
LordDaimos LordDaimos is offline
Newbie Coder
 
Join Date: Apr 2005
Location: Vännäs, Sweden
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

Sounds a lot like the T9 system that many mobile phones use: http://www.t9.com/
__________________
CrazyBeaver Software - All you need on the web
Download Opera - The only good choice for internet browsing
Reply With Quote
  #4 (permalink)  
Old 09-07-05, 02:15 PM
necro_mancer's Avatar
necro_mancer necro_mancer is offline
New Member
 
Join Date: Sep 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

hye...i already go to www.t9.com and i got the idea...

after i read the question over and over...i realize...the question just wanna convert from word to number...

so i make it...but still have a problem... try find out yourself..
i found that...after the 8 phone number..there is a symbol..i dont know how to remove it....

BTW i use c not c++..

ONE MORE THING, DONT USE CAPITAL WORDS BECAUSE THE COMPUTER WILL HANG.. i dont know why...can somebody help me fix this problem?

thanks


/////////////////////////SOURCE CODE////////////////////////////////////////////

#include<stdio.h>
#include<conio.h>
#include<iomanip>
const char to_num_table[] = "2223334445556667077888999";
int main(void)
{


printf("\n**************************************** **************************************");
printf("\n**************************************** **************************************");
printf("\n DE TELEPHONE NUMBER WORDZ GENERATORZ v1.0");
printf("\n**************************************** **************************************");
printf("\n**************************************** **************************************\n\n\n");



int i,j;
char input[8];
char output[1];
char current_char;
printf("Enter The Name (Must be in 8 characters): \n\n\n");
for(i=0;i<8;i++)
{

scanf("%c",&input[i]);
}
printf("The Telephone Number Are:");
for (i=0; (current_char = input[i]) != 0;i++)

{

if (current_char >= 'A' && current_char <= 'Z')
output[i] = current_char - 'A';
else if (current_char >= 'a' && current_char <= 'z')
output[i] = to_num_table[current_char - 'a'];
else output[i] = current_char;

}

output[i] = 0;

puts(output);

getchar();
system ("pause");
return (0);

}


Reply With Quote
  #5 (permalink)  
Old 09-07-05, 04:01 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
so you found yourself a solution!? that's nice
unfortunatly, my box doesn't have a C compiler so I can not test it but I will take the code to my other PC and try it

anyway, back to the C forum since you managed to create the app.
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Mysql to Excel mcrob PHP 8 07-12-05 06:49 AM
Find the beginning letter of a word mcrob PHP 6 05-23-05 10:06 AM
a version of 'nl2br($file_read);' for word files buzzby PHP 1 05-07-05 12:53 PM
what is the best method to find last word in variable ? GS300 PHP 6 09-15-04 09:13 PM
Replace A Word With Another Word cebuy PHP 7 08-03-03 08:29 PM


All times are GMT -5. The time now is 04:34 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.