HW4

new Due day

Wed 3/2 5 pm.

Description

One a phone, alphabets corresponds to numbers.
1 2
ABC
3
DEF
4
GHI
5
JKL
6
MNO
7
PQRS
8
TUV
9
WXYZ
* 0 #
Example, program corresponds to 7764726.
Write a program allows the user to enter a phone number. The program will find the corresponding English word.

Download

Download the dictionary word list here.

Sample Output of the program

C:> perl -w phone.pl dictionary.txt 
Please enter a phone number: 7764726
program
C:> perl -w phone.pl dictionary.txt 
Please enter a phone number: 7282437
patcher
patches
ratches
ravager
ravages
saucier
savager
savages
C:> perl -w phone.pl dictionary.txt 
Please enter a phone number: 2222
abba
baba
caca
C:> perl -w phone.pl dictionary.txt 
Please enter a phone number: 2345678
No match for 2345678.
C:> perl -w phone.pl dictionary.txt 
Please enter a phone number: 22aa2
Please enter digits only.

Submission

Name your file phone.pl. Put the file in the submit folder!
All source code submitted must contain the following information at the beginning of each file:
    * Your full name.
    * Your student ID number.
    * Your PIC login ID.
    * Your e-mail address.
    * Your discussion section number and TA's name.
    * The assignment number and description.
    * Honesty pledge.

Properly formatted, this information should appear as follows:
 # Name:		Charles Li
 # Student ID:		000 000 000
 # PIC ID:		ccli
 # E-mail:		ccli@math.ucla.edu
 # Assignment:		hw1
 #
 # I, Charles Li, pledge that this is my own independent work, which 
 # conforms to the guidelines of academic honesty as described in the course 
 # syllabus.