CSSE 120 — Introduction to Software Development, Robotics

Homework 2

Reminder: for each class session and associated homework:

  • You generally have reading to do.
  • You do all other work in Eclipse in the project that you checked out for that session.
  • You turn in your Eclipse work by committing that project:
    • Right-click on the project name in the Pydev Package Explorer view.
    • Select Team → Commit
    • In the message box that appears, put a message to yourself if you wish (eventually, these messages will be for your teammates) and press OK.
    It is a GOOD idea to COMMIT OFTEN, not just when you finish the homework. Doing so provides easy backups of your work.

Questions? Email csse120-staff@rose-hulman.edu.

Best place and time to do the homework: CSSE lab (Moench Hall, room F-217), 7 p.m. to 9 p.m., Sunday — Thursday.

Today's project: Session02_FunctionsObjectsAndMethods

Main learning objectives for this homework:

  • Continuing to get familiar with Eclipse (your IDE — Integrated Development Environment)
  • The basic structure of a Python program in our style: main.
  • The input/compute/output pattern:
    • Prompting for and getting input from the user
    • Using variables to store values
    • Printing strings and the values of variables
  • Defining functions versus calling functions
  • Printing versus returning a value
  • Objects:
    • Constructing
    • Using

Additional learning objectives for this homework:

  • A brief introduction to the hardware of the iRobot Create

Do the following exercises. For problems 2 and following, use today's project: Session02_FunctionsObjectsAndMethods

  1. Complete the assigned reading for the next session, Zelle, §2.5–2.8.
  2. Do the TODO's in the m2_distance_from_origin.py module of today's project, if you did not complete them in class.
  3. Do the TODO's in the m3_print_vs_return.py module of today's project, if you did not complete them in class.
  4. Do the TODO's in the m5_logarithm.py module of today's project.
  5. Do the TODO's in the m6_sines_print_vs_return.py module of today's project.
  6. Do the TODO's in the m7_picture.py module of today's project. Note its INSTRUCTIONS near the top of the module.