HTTLACS: Ch 3 Exercises

From WLCS

Directions:

  1. Open a new Google Drive document
  2. Put your name at the top
  3. Title the document as YOURLASTNAME_ch3
  4. Complete the exercises below in this file. If you use WingIDE, then be sure to copy & paste your code into the Google Doc
  5. Be sure to number each of your answers!!

References:

Exercises:

  1. Define the term: function definition
  2. Where are all function definitions supposed to be placed?
  3. Define the term: function header
  4. Define the term: function body
  5. What does a function call do?
  6. Define a function named new_line() that prints out an empty line. Test it out with a function call to new_line()
  7. Define a function named printHighFive() that prints out "High five!" 5 times. Test it out with a function call to printHighFive().
  8. Define a function named print25High() that calls printHighFive() 5 times so that "High five" is shown 25 times. Test it out with a function call to print25High()
  9. Define the term: parameter
  10. What is the parameter in the following function header? def f(x):
  11. Complete the function body for def f(x): so that the cube of x is printed out (HINT: x to the power of 3)

Submit: