Hey! Someone please help me with this lab. They asked the user to type a word and the program gonna print the value of the word. And each letter has a value.
here's the project:
A, E, I, M, Q, U, Y are worth 1 point
B, F, J, N, R, V, Z are worth 2 points
C, G, K, O, S, W are worth 3 points
D, H, L, P, T, X are worth 5 points.
Any word that contains two (or more) of the same letter in a row has it's value doubled. Some examples are 'asset' and 'little'. You can only double things once.
Your program should ask the user for a word (without spaces) and print it's value.
Ignore any special characters or numbers that are entered.
1. Get the input and store it in a string.
2. Make a copy of the string and sort it .
3. Create a variable value and set it to 0.
4. Get the value of the string by looping through the string character by character and update the
value.
5. Loop through the string again and check for 2 adjacent letters. If you found one pair you
double the value.
6. Display the result.