I'm a beginner at C++ and I'm having a really hard time with the problem that my teacher gave me to do. The program is about a game of scrabble in which we have to make a program that will add up the number of points for each word is the the sum of the values of the letters in the word.
I'll be given one or more words, one per line. The # sign will represent blanks. And the end of the sequence of words will be marked by one line of input containing $. The end result should be a statement stating the player's score. The letter values are as follows: # = 0 A,E,I,L,N,O,R,S,T,U = 1
D,G = 2 B,C,M,P = 3 F,H,V,W,Y = 4 K=5 J,X = 8 Q,Z = 10
The input will be a sequence of 2 or more lines w/the last line having the $. And the output will have the statement showing the players score.
example: Input: DAY#TIME
$
Output: The player's score is 13.
I know that the basic setup is:
#include<iostream.h>
int main()
{
return0;
}
And that you include this: while(letter!='$') to tell the program when to stop, but as for everything else like setting up the letter values and the code for the actually add itself I'm so lost on. Can anybody help me please?
I'll be given one or more words, one per line. The # sign will represent blanks. And the end of the sequence of words will be marked by one line of input containing $. The end result should be a statement stating the player's score. The letter values are as follows: # = 0 A,E,I,L,N,O,R,S,T,U = 1
D,G = 2 B,C,M,P = 3 F,H,V,W,Y = 4 K=5 J,X = 8 Q,Z = 10
The input will be a sequence of 2 or more lines w/the last line having the $. And the output will have the statement showing the players score.
example: Input: DAY#TIME
$
Output: The player's score is 13.
I know that the basic setup is:
#include<iostream.h>
int main()
{
return0;
}
And that you include this: while(letter!='$') to tell the program when to stop, but as for everything else like setting up the letter values and the code for the actually add itself I'm so lost on. Can anybody help me please?