$30
ECE-203 Programming for Engineers
Laboratory Experiment 7
Name:
In Lab Assignment (Due end of this lab session)
(40 Points) You are to write a program that converts sentences constructed using text message (SMS)
slang into sentences using the proper King’s English. Your program should be aware of the following SMS
slang equivalences:
SMS Slang King’s English
gr8 great
btw by the way
imho in my humble opinion
jk just kidding
l8r later
np no problem
r are
u you
y why
ttyl talk to you later
l8 late
atm at the moment
lmk let me know
np no problem
tia thanks in advance
brb be right back
Punctuation marks will mess up your program if you are not careful. You will need to check for punctuation,
save the punctuation, perform the translation, and then put the punctuation mark back. You can check if
the last character of a word is a punctuation mark using:
1 if word[-1] in ".?!,;:":
2 print "The last character is a punctuation mark!!"
The last character can be trimmed using the string.rstrip() method.
Your program should take input from the user (written in SMS slang) and convert it into the King’s English.
Your program should make use of a dictionary. Show your completed program to the TA and demonstrate
that it works.
Example Output:
Enter message to translate: y r u l8?
Message in the King’s English: why are you late?
TA Initials
1