Converting words to numbers

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bill Gowan (gowan_at_frontiernedotnet)
Date: 03/10/05


Date: Thu, 10 Mar 2005 18:23:59 -0500

I had a teacher ask me if I could write a program that would convert words
to numerical equivalents. It's been a long time since I have done
programming so I am asking for help.

She is going to tell the kids they need to come up with a word that equal
(lets say) 30.

We always assume that a=1 b=2 c=3 d=4 etc.

Can anyone help me?

I managed to get the word that was entered and the length of the word. I
think the next think I have to do is convert the word into an array and then
convert each letter into a number.

The place I am stuck is converting the word into an array that I can work
with.

Thnaks in advance for any help!



Relevant Pages

  • Re: Converting words to numbers - Thanks!!
    ... >I had a teacher ask me if I could write a program that would convert words ... > The place I am stuck is converting the word into an array that I can work ... > Thnaks in advance for any help! ...
    (microsoft.public.excel.programming)
  • Re: Comments on parsing solution.
    ... keeps @files unique too; ... You don't need this function, though, as my code keeps the array ... "A teacher is never a giver of truth - he is a guide, a pointer to the truth that each student must find for himself. ...
    (comp.lang.perl.misc)
  • Re: Splicing exercise
    ... will splice the a2.length elements of array a2 INTO array a1", ... function insertArray(a1, a2, pos) { ... But I wouldn't be a good teacher (and we're all teachers here, ...
    (comp.lang.javascript)
  • Re: pointer usage in c
    ... > char *foo; ... > from function foo() is not guaranteed to be preserved. ... I think my teacher wrong. ... This array, like all auto objects, has ...
    (comp.lang.c)
  • Variable-Length Arrays (was Re: Something wrong in my program)
    ... though it is called a variable length array. ... Rot13 and convert spelled-out numbers to numerical equivalents. ...
    (comp.lang.c)