Practice Assignment

(scrabble1.c)

Information

  1. Write a program that prompts the user for an English word, and then prints out the value of the word based on the game of Scrabble. In the game of Scrabble, each letter is worth a certain number of points, based on the frequency with which it occurs in the language:

    PointsLetter
    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

    Here is the output from the program run multiple times interactively:

    Enter a word: apple
    Scrabble value is : 9
    
    Enter a word: Apple
    Scrabble value is : 9
    
    Enter a word: APPLE
    Scrabble value is : 9
    
    Enter a word: banana
    Scrabble value is : 8
    
    Enter a word: zebra
    Scrabble value is : 16
    
    Enter a word: quizzify
    Scrabble value is : 41
    
    Enter a word: Oxyphenbutazone
    Scrabble value is : 41
    

    The program only prompts for one word, prints the value, and then exits. The output above was produced by running the program 7 times.

    The name of the file should be scrabble1.c and the command to compile it will look like this:

    gcc -Werror -Wall -Wextra -ansi -pedantic -O2 -Wno-unused-result -o scrabble1 scrabble1.c
    
    Files:

Notes