Question
C++ code only please...... Overview: Synopsis: Type in a word and get a point value. A point value is the sum of the points of
C++ code only please......
Overview:
Synopsis: Type in a word and get a point value. A point value is the sum of the points of the individual letters multiplied by any bonus multipliers (defined later).
In both Words With Friends and the scrabble game, a individual letters in a word are given specific values.
Your program will let me keep typing in words and giving me the point value until I stop the program.
---------------------------------------------------------------------------------------------------------------------------------------------
Basic Point values:
For this lab, calculate the value of a word with the following specific rules:
A, E, I, O, S, U are worth 1 point
D, F, G, L, M, N, R, T are worth 2 points
B, C, K, P, Y are worth 3 points
H, J, Q, V, W, X, Z are worth 5 points.
If the word was CAT, the value would be 3 + 1 + 2 or 6 points.
-------------------------------------------------------------------------------------------
Bonus Point multipliers
DOUBLE: 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.
TRIPLE: Any word that has three (or more) 1 point letters has it's value triples. You can only triple a word once. 'asset' has 4 single point letters (a, s, s, and e), while little only has 2 (i and e)
You can both DOUBLE and TRIPLE a word.
--------------------------------------------------------------------------------------------------------------------------------------------
Dictionary Lookup
You also need to check to see if the word is in a dictionary. There's one at
http://www.csit.parkland.edu/~kurban/permanent/lists/ and it's called web2.txt
It contains one word per line and is already sorted. You can make your own smaller dictionary to test it if you like.
Please do not turn in the dictionary.
-----------------------------------------------------------------------------------------------------------------------
Requirements
Your program will ask the user for a word (without spaces) and print it's value.
Ignore any special characters or numbers that are entered. [I won't include these in my test cases].
If the word isn't in the dictionary, report that the word isn't a valid word.
You HAVE to use my rules or you will receive 0 credit!
----------------------------------------------------------------------------------------------------------
Examples:
asset = (1 + 1 + 1 + 1 + 2) * 2 * 3 = 18 (double letters, 3 single point letters)
little = (2 + 1 + 2 + 2 + 2 + 1) * 2 = 24 (double letters)
abacadabra = (1 + 3 + 1 + 3 + 1 + 2 + 1 + 3 + 2 + 1) * 3 = 56 (3 single point letters)
football = (2 + 1 + 1 + 2 + 3 + 1 + 2 + 2) * 2 * 3= 84 (double letters only double once, 3 single point letters
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started