CSSE 120 — Introduction to Software Development, Robotics

Homework 2

Reminder: for each class session and associated homework:

  • Where you do your work: In Eclipse in the project that you checked out for that session.
  • How you turn in your work: You commit that project, as follows:
    • 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.
    Commit OFTEN, not just when you finish the homework. Doing so provides easy backups of your work.
  • How you can keep track of what you have completed:
    • As you finish each TODO, change the word TODO to DONE.
    • When you finish ALL your work in a project, right-click on the project name and Rename the project by adding Done to the beginning or to the end of the project name.
      • Keep the rest of the project name unchanged, to keep things simple.
      • You choose whether to place Done at the beginning or end of the project name, depending on how you like the projects sorted.
      • The exact phrase Done is not important; any phrase that helps you remember that you have done the project is fine.
    • If you have 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)
  • Continue practicing how you get projects from your SVN repository and turn them in: Checkout and commit .
  • The basic structure of a Python program in our style: main, which calls other functions.
  • 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:

  • Continue our introduction to counting loops (FOR statements with RANGE expressions)
  • Continue our work on converting a string to a floating-point number, using the float function.

Do the following exercises, using today's project: Session02_FunctionsObjectsAndMethods

  1. Do the TODO's in the m2_distance_from_origin.py module of today's project, if you did not complete them in class.
  2. Do the TODO's in the m3_print_vs_return.py module of today's project, if you did not complete them in class.
  3. Do the TODO's in the m5_logarithm.py module of today's project.
  4. Do the TODO's in the m6_sines_print_vs_return.py module of today's project.