Hi!
I'm trying to compile a small program in C++ ... I've not programmed anything since quite some years.. So I'm asking here..
I want to give a digit value to each alphabet of the english letters uptil 9.
A : 1
B : 2
C : 3
D : 4
E : 5
F : 6
G : 7
H : 8
I : 9
J : 1
K :2
L : 3
and so on.... so A to I = 1 to 9 ... J to R = 1 to 9 again... and so on... with Z = 8.
After setting these values, I need to take input from the user for a string. for example: TEOTI
Then I trying to add the lettered values to a total: T + E + O + T + I = 2 + 5 + 6 + 2 + 9 = 24.
So I'm trying to get a total of 24 from this program on a user input of 24.
Please please can someone help me in this??
I've tried a lot with simplest of coding that I remembered but couldn't figure out how to get that total.
Thanks for any help.
-Mohit.



