8.27 LAB: Scrabble points Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Ex: If the input is: PYTHON the output is: 14   Use Python for this.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 9E
icon
Related questions
Question

8.27 LAB: Scrabble points

Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board.

Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board).

Ex: If the input is:

PYTHON

the output is:

14

 

Use Python for this.

**Lab Activity: 8.27.1 - Scrabble Points**

**Description**

This lab involves writing code to calculate the score of words in a Scrabble game using the provided `tile_dict` dictionary.

**Code Snippet:**

```python
tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8,
              'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1,
              'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 }

# Type your code here.
```

**Instructions:**

1. The provided dictionary, `tile_dict`, assigns a point value to each letter from A to Z, similar to the official Scrabble scoring system.
2. Your task is to write a function or piece of code that computes the total score of a given word based on these letter values.

**Note:**

- The editor is set up for you to enter your code below the comment `# Type your code here.` 
- Ensure that your code reads the word input and correctly accumulates the total score using the values from the dictionary.

**Usage Example:**

If a user inputs the word "HELLO," your code should calculate and return the total score by summing the values for each letter: 
H(4) + E(1) + L(1) + L(1) + O(1) = 8 points.

**Next Steps:**

- Explore ways to handle invalid characters or inputs.
Transcribed Image Text:**Lab Activity: 8.27.1 - Scrabble Points** **Description** This lab involves writing code to calculate the score of words in a Scrabble game using the provided `tile_dict` dictionary. **Code Snippet:** ```python tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 } # Type your code here. ``` **Instructions:** 1. The provided dictionary, `tile_dict`, assigns a point value to each letter from A to Z, similar to the official Scrabble scoring system. 2. Your task is to write a function or piece of code that computes the total score of a given word based on these letter values. **Note:** - The editor is set up for you to enter your code below the comment `# Type your code here.` - Ensure that your code reads the word input and correctly accumulates the total score using the values from the dictionary. **Usage Example:** If a user inputs the word "HELLO," your code should calculate and return the total score by summing the values for each letter: H(4) + E(1) + L(1) + L(1) + O(1) = 8 points. **Next Steps:** - Explore ways to handle invalid characters or inputs.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Parallel Processing
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr