CSSE 120 -- Intro. to Software Development

Homework 2

  1. Complete the assigned reading for the next session (see the course schedule).
  2. Complete the Angel quiz over this reading. You'll find this on the course Angel page, under Lessons → Homework → Homework 2 → Writing Simple Programs
  3. Complete Programming Exercise 1.3 on page 23 of Zelle. Write your 1 paragraph essay in a text file named homework2.txt. You do not have to include the code that you wrote, just your paragraph.
  4. Complete Programming Exercise 1.4 on page 23 of Zelle. Write a short paragraph explaining what change you had to make to the program. Put your paragraph in the same homework2.txt file that your created for the previous problem. Again, you do not have to include the code that you wrote, just your paragraph. Be sure to clearly indicate which paragraph answers which question.
  5. Implement a Python program that calculates the distance between two points. Name your program pythagoras.py. Your program should:

    1. Prompt the user to enter the x and y coordinates for two points.
    2. Use the math module to calculate the distance between the points. (If you don't remember how to import the math library, see the transcript from Session 1.) You'll find the sqrt function helpful.
    3. Display the distance between the points, with a descriptive label.
  6. Turn in instructions:

    1. Find the drop box on the course Angel page, under Lessons → Homework → Homework 2 → HW2 Drop Box
    2. Upload your:
      • homework2.txt file, and
      • pythagoras.py program

      to the Homework 2 drop box on Angel. (You can upload multiple files in the Attachment dialog.)

  7. Web links, bacon, eggs, and spam: The Python programming language was named for the English comedy team Monty Python. The Python community on-line is fond of making "in-joke" reference to various Monty Python sketches. One of today's in class examples was a reference to the legendary Dead Parrot Sketch. Watch the five minute video and start to become a member of the Python community!