Compsci 101, Fall 2012, First Day

By entering your name/net-id below you indicate you are in class on August 27 to answer these questions and that you have answered them. Your name should not appear unless you are in class and an active participant in answering these questions.
Name_________________   net-id _______   Name_________________   net-id _______


Name_________________   net-id _______   Name_________________   net-id _______

  1. In the session of Python done in the browser using the tool from skulpt.org what is the name of the function being run?

    1. test

    2. name

    3. def

  2. What's the best way to change the program shown so that it prints Hello Jello

    1. Change the call to test("Jello")

    2. Change the print statement to print "Hello Jello"

    3. replace the entire browser window with one statement print "Hello Jello"

  3. We'd like to change the function test so that it can print messages like "Hello pretty leopard", "Hello slimy toad", "Hello giant panda", i.e., so that a Hello greeting is printed for an animal with an adjective so that both can be changed easily. Which of the following (more than one can be correct) is a good choice for the function header.

    1. test(adj,animal)

    2. test(x,y)

    3. test(adjectiveanimal)

    4. test(animal,adjective)

  4. Use this Khan Academy introduction to Computer Science. Manipulate the variable eyeSize so that the circel that's the right eye-ball just touches (is tangent to) the border of the yellow face circle. Which of the following is closest to the value of the variable when you're done?

    1. 39

    2. 49

    3. 59

    4. 69

  5. Manipulate the fill function used to create the color of the mouth so that the mouth is some shade of Duke blue. There are three parameters to the fill function. What's the value of the third parameter when you've made a Duke blue mouth (pick the closest value).

    1. 90

    2. 130

    3. 170

    4. 210

    5. 250