Assignment 9

advertisement
Assignment 9: JavaScript Functions
due: start of class, 7/20
Read Snyder Chapter 20
Do: Lab 4.3 Revised
10 Points Total
Name_________________
Lab 4.2 Exercises
During the laboratory, record your answers to the questions that are asked in steps:
Part 1
4. Does the alert dialog box appear?
How about when you click the Tell a story button?
5. Do you expect the dialog box to appear when you reload the page now? How
about when you click the button?
7. Where do the strings you pass in for name and contentString appear in the pop up
window?
Part 3
12. How you would use both the capitalizing and “a”/“an” functions together to do
this? You can explain by giving a code example or using words.
Post-lab Questions
Write your answers after completing the lab, but read them carefully now and keep
them
in mind during the lab.
1. In an error-free JavaScript program, can you have a function definition without a
call to it?
Can you have a call to a function without a definition for it?
2. Syntactically (grammatically) speaking, i.e., looking at JavaScript code, how can
you distinguish a function definition from a function call?
3. In this lab, you produce a page that allows the user to “fill in the blanks” in various
formula operations. Describe how “filling in the blanks” is one way to think of what
happens when a function with parameters is called. In the context of calling functions,
what are the blanks, and what is used to fill them?
Chapter 20 Exercises:
Multiple choice:
1___ 2___ 3___ 4___ 5___ 6___ 7___ 8___ 9___ 10___
Short Answer:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10
11.
12.
Exercises:
3.
7.
8.
9.
Download