CSSE 120 -- Intro. to Software Development

Homework 3

  1. Complete the assigned reading for the next session, Zelle, §3.4–4.3.
  2. (29 pts) Complete the Angel quiz over this reading. You'll find this on the course Angel page, under Lessons → Homework → Homework 3 → More Types, Strings and Lists
  3. (10 pts each) Finish the pair-programming exercise you started in class: factorial.py, and upload them to the corresponding drop box on the course Angel page under Lessons → In-class Exercise Drop Boxes
  4. (10 pts) With your partner, cause the robot to do some simple actions: first play a distinctive sound as a warning sound. After the sound stops, have the robot repeatedly (4 times) spin 45 degrees CCW and back 45 degrees CW. (You might envision the robot looking back and forth nervously getting ready to move). Name your program simpleRobot.py.
    1. Don't forget to turn on the robot and bluetooth connection before you start.
    2. Ask the user for the port to which the robot is connected.
    3. Use the sleep() command as needed.
    4. Even if you aren't musical, you can still create interesting, distinctive sounds using a loop!
    5. If you forgot any of the commands we did in class yesterday, you can use the documentation, pycreate.pdf, that came with the create library you downloaded as part of HW1.
    6. Note: The maximum forward speed is 50 cm/sec and rotational speed is 60 degrees/sec.
  5. (10 pts) Complete Programming Exercise 2.4 on page 49 of Zelle. Name your program conversion.py. Edit the comments at the top of the program to appropriately describe how the program behaves. Be sure to include your name in the comments as the author of conversion.py. You do not have to include results from running your program, just your code.
  6. (10 pts) Complete Programming Exercise 3.2 on page 72 of Zelle. Again include appropriate comments. Name your program area.py. Your program should:

    1. Prompt the user to enter the diameter and price of the pizza.
    2. Use the math module to get the value of pi. (If you don't remember how to import the math module, see the transcript from Session 1.)
    3. Display the cost per square inch, with a descriptive label.
  7. Turn in instructions:

    1. Find the drop boxes on the course Angel page, under Lessons → Homework → Homework 3
    2. Upload your:
      • conversion.py file
      • area.py file
      • simpleRobot.py file

      to the corresponding drop boxes on Angel.