CSSE 120 — Introduction to Software Development

Homework 16

Reminder: for each class session and associated homework:

No reading for next time

There is no reading or quiz due next session.

Tasks

Solo Programming: Complete these tasks in the 16-Dictionaries project that you checked out in class.

  1. (15 points)  Finish the Blackjack with dictionaries exercise that we started in class. Commit your solution to your individual SVN repository.
  2. (25 points) Texting Translator Granny just got a cell phone, and wants you to text her to keep her up to date. However, she doesn't know any standard texting abbreviations, and the thought of having to write everything out is both repulsive and expensive!

    Create a module called textExpander.py in the 16-Dictionaries project. Write a program in that module that Granny could use to translate from text abbreviations to Granny-speak.

    The program should prompt the user to enter a sentence. As each sentence is entered, it expands any texting abbreviations in the sentence into full words. You should store the abbreviations and full words in a dictionary. Your dictionary should include at least these:

    r are
    k okay
    lol laugh out loud
    imo in my opinion
    jk just kidding
    g grin
    hw homework

    You don't need to handle punctuation, and your output need not preserve the exact whitespace entered, as shown:

    Please enter your text after each prompt. <Enter> to quit.
    >imo you r great
    in my opinion you are great 
    >lol g g
    laugh out loud grin grin 
    >got to do my hw
    got to do my homework
    > 
    

Turn In

Be sure to commit your code to SVN when you’re finished, or more frequently.