>>    




Homework Assignment

CS 121 (CS1)

Homework 4   Due Wednesday, February 19, 2014
  1. Text questions on functions

      Exercises 2,9,10,11 at the end of Functions.
  2. Functions and specs

    1. double -- [H] Double problem. Problem 1 at this link.
      Notes:
      • To submit this problem, write your answer on a piece of paper or create an electronic document, and submit either on paper or attached to an email.

      • See the CS1 glossary for definitions of terms that are not listed in the text. For some examples, consider the following code:

        	    def mean(num1, num2):
        		x = 2
        		return (num1 + num2)/x
        
        	    mean(3, 8)
        

        • mean(3, 8) is a function call

        • num1 and num2 are formal arguments

        • 3 and 8 are actual arguments

        • x is a local variable. That variable is only defined within the definition of mean().


    2. Additional questions Postponed
  3. Trees


  4. Reading

    1. -- Read online text: Functions if you haven't already.
      submit at least one reading question by 9am before the next class meeting.

    2. -- Read online text: Selection.
      submit at least one reading question by 9am before the next class meeting.