CSSE 120 — Introduction to Software Development

Homework 10

Reminder: for each class session and associated homework:

  1. Complete the assigned reading for the next session: Zelle, chapter 8.
  2. (22 points) In ANGEL, complete the Reading Quiz over the above reading.
  3. Solo Programming: The remaining exercises are to be done in the 10-Functions project that you checked out in class.
    1. (20 points: 5 for writeStuffToFile, 5 for readAndPrintMyself, and 10 for writeCosinesToFile)

      Complete the above functions in the filesPhile.py module.

      for writeCosinesToFile, the output must match the example output specified in HW9

      • Instructions are in the module.
      • Simply do the TODO's in the module, in the order listed (1, 2, 3, ...).
      • You can navigate to the TODO's easily if you do
           Window ~ Show View ~ Tasks
        

      Submit your Python source file by committing your changes to your SVN repository.

       

    1. Pair Programming with someone that you have not paired with previously. Be sure to follow the advice for pair-programming so that both partners learn all the material covered and get credit for the work.

    2. (40 points) Cross Words: This problem requires you to combine string and sequence methods, loops, and graphics. You'll develop a program that accepts two words from the user using a GUI. Then it finds the first character in the second word that happens to appear in the first word. It draws the two words so that they cross through each other.

      You'll solve the problem in stages, with partial credit for each stage completed. The stages are given by TODO items in the module crosswords.py. Below are some sample outputs that are part of the specification. Your program must behave like these examples to receive full credit.

      Here's a video demo of a solution that you might find useful.

      First Word Second Word Expected Display
      hello world
          W
      HELLO
          R
          L
          D
      
      pale ale
      PALE
       L
       E
      
      cAt BoT
        B
        O
      CAT
      
      Ames Iowa
      I
      O
      W
      AMES
      
      Fat Tire
      FAT
        I
        R
        E
      
      Happy Hanukah
      HAPPY
      A
      N
      U
      K
      A
      H
      
      Joyous Festivus
           F
           E
      JOYOUS
           T
           I
           V
           U
           S
      
      Merry Christmas
        C
        H
      MERRY
        I
        S
        T
        M
        A
        S
      

      Note that the correct output for "hello" and "world" is not

      
        W
        O
        R            <--- WRONG, WRONG, WRONG
      HELLO
        D
      

      After each TODO item that you successfully complete, and more often if you wish, commit your work to your SVN repository.

    3. (10 points bonus) Bonus: Modify your crosswords.py module so that instead of exiting after two words, it repeats. With each repeat, pick a new, random location on the window at which to draw the words. Be sure to commit your work for the previous part before attempting this part. We don't want you to lose regular points because you attempted the bonus and broke something.