Question: Exercise 8.5 A. In Scrabble each player has a set of tiles with letters on them, and the object of the game is to use
Exercise 8.5
A. In Scrabble each player has a set of tiles with letters on them, and the object of the game is to use those letters to spell words. The scoring system is complicated, but as a rough guide longer words are often worth more than shorter words.
Imagine you are given your set of tiles as a String, like "qijibo" and you are given another String to test, like "jib". Write a function called TestWord() that takes these two Strings and returns true if the set of tiles can be used to spell the word. You might have more than one tile with the same letter, but you can only use each tile once.
B. In real Scrabble, there are some blank tiles that can be used as wild cards; that is, a blank tile can be used to represent any letter.
Think of an algorithm for TestWord() that deals with wild cards. Dont get bogged down in details of implementation like how to represent wild cards. Just describe the algorithm, using English, pseudocode, or C.
Both questions in C.
Both questions are tested inside full programs. Not tested together.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
