Information
Points | Letter |
---|---|
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:
Files:gcc -Werror -Wall -Wextra -ansi -pedantic -O2 -Wno-unused-result -o scrabble1 scrabble1.c
Notice the first output redirection is a single >, but the rest are double >>.scrabble1 < input1.txt > myoutput.txt scrabble1 < input2.txt >> myoutput.txt scrabble1 < input3.txt >> myoutput.txt scrabble1 < input4.txt >> myoutput.txt scrabble1 < input5.txt >> myoutput.txt scrabble1 < input6.txt >> myoutput.txt scrabble1 < input7.txt >> myoutput.txt
Notes