25-section-3

25-section-3 - CS 106A Handout #25 July 14, 2009 Section...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Handout #25 CS 106A July 14, 2009 Section Handout #3 String Processing 1. Scrabble scoring (Chapter 8, exercise 5, page 286) In most word games, each letter in a word is scored according to its point value, which is inversely proportional to its frequency in English words. In Scrabble, the points are allocated as follows: Points Letters 1 A , E , I , L , N , O , R , S , T , U 2 D , G 3 B , C , M , P 4 F , H , V , W , Y 5 K 8 J , X 10 Q , Z For example, the Scrabble word FARM is worth 9 points: 4 for the F , 1 each for the A and the R , and 3 for the M . Write a ConsoleProgram that reads in words and prints out their score in Scrabble, not counting any of the other bonuses that occur in the game. You should ignore any characters other than uppercase letters in computing the score. In particular, lowercase letters are assumed to represent blank tiles, which can stand for any letter but which have a score of 0.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
– 2 – 2. Adding commas to numeric strings (Chapter 8, exercise 13, page 290)
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

25-section-3 - CS 106A Handout #25 July 14, 2009 Section...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online