CSCI 1300 - Programming Assignment 2
Some Short Programs with Functions

Dates:

  • Start: Immediately after your recitation on week of Aug 30.
  • Due: Wednesday, September 8.
  • Late work accepted without penalty: Thursday, September 9.
  • Late work accepted with penalty: Through Saturday, September 11.
  • No work accepted after September 11.

    Programming Assignment

    Make sure that you are keeping up with the assigned reading from the syllabus at www.cs.colorado.edu/~main/intro/syllabus.html.

    Complete program 4 from page 152. Your program must include functions with these exact prototypes:

       // COMPUTES THE SPEED OF A RUNNER IN FEET PER SECOND.
       // THE PARAMETERS ARE THE NUMBER OF *MILES* TRAVELED AND
       // THE NUMBER OF *SECONDS* REQUIRED TO TRAVEL THIS DISTANCE.
       float feet_per_second(float miles_traveled, float seconds);
    
       // COMPUTES THE SPEED OF A RUNNER IN METERS PER SECOND.
       // THE PARAMETERS ARE THE NUMBER OF *MILES* TRAVELED AND
       // THE NUMBER OF *SECONDS* REQUIRED TO TRAVEL THIS DISTANCE.
       float meters_per_second(float miles_traveled, float seconds);
    

    Also write a program to calculate something interesting of your own choosing. For example, if you are interested in physics, you might write an expansion of my program to calculate the time of an interstellar journey. Whatever you write should include at least three functions, two of which have some arguments.

    Make sure that your programs follow good documentation standards and have the same information required for the first homework assignment. The specific style guidelines that the graders will use is posted at http://www.cs.colorado.edu/~main/intro/style.html . However, for this assignment, the graders will not yet require NMR or NGE.

    Submit both of your files as Homework 2 to www.cs.colorado.edu/~main/dora/

    Optional: If you like, your second program may include the graphics operations that I'll start to talk about on Sep 6.