Question: in c++ You will write a scrabble world scorer. The user will input a word of 10 letters or less and your program will calculate
in c++
You will write a scrabble world scorer. The user will input a word of 10 letters or less and your program will calculate the score of that word (ignoring scrabble tiles like triple world score etc.
1) You must prompt the user for a lower case word of 10 letters or less
2) You must save the word the user types in into a character array (review the lecture and think about the dimension of this array)
3) You must have a function, let's call it CalcScrabbleWordScore that takes in a character array as a parameter (it could also take in a length if you would like, but since this character array follows the rules of a C-String it doesn't have to) and returns an integer value representing the score of that given word (here is a scrabble word calculator to play around with(http://www.thekatespanos.com/scrabble-score-calculator/). Your function should have a the pre and post condition clearly commented in both the prototype and function definition
4) Inside the function definition you must have an array (or arrays) that keep track of the score for each letter tile in scrabble (you can find those defined here
http://www.wordfind.com/scrabble-letter-values/
Hint: You can do this with two arrays-- one with the letters in them 'a' 'b' 'c' etc and another with the point values in them 1 3 3 etc.
There is also a way you can do this with 1 array by exploiting ascii lookup tables. Both ways are valid (or any other way as long as you have an array representing the scores)
5) Somehow your function should figure out how much the word is worth and return that value.
6) The only input and output for the whole program should be in the main function.
7) Your program input and output must match the test cases below
8) In addition to the pre and post conditions your code should be appropriately commented
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
