Lesson #4 Review Questions

Back to Lesson # 4 Functions Table of Contents # 4 Assignment

 

 

1. In programming, a 'function' is just a way of

creating a block of statements that execute when called
grouping statements together that are logically related
simplifying the design process to make it easier to develop more complex programs
All of the above
2. Top-Down design means

Breaking a large task into progressively smaller subtasks
The top designer gets to make the important decisions
Design the tiny details first, then the program will work better.
Use functions for all statements
3. The code for the statements in a function is generally placed where?

in the <BODY> section
in the <HEAD> section
in the <INPUT ...> tag
in the <TITLE> section
4. When do the statements inside a function execute?

As the document loads
As the document unloads
Only when called by the function name.
In alphabetical order by function name
5. Function names are always followed by parentheses (), even when the parentheses are empty.

True
False
6. When we send information to a function, it is enclosed in the parentheses and is called the:

Valuation
Argument
Arduous
Global Value
7. Which of the following is NOT true?

The number of arguements sent to a function must be the same as the number of parameters in the function definition.
The data types of the arguments must match the types of the parameters in the function definition.
Arguments cannot be sent in JavaScript
Arguments are stored in the functions internal variables.
8. The keyword 'return' is used for

returning a value because it was invalid.
returning control to the home page window
returning to the top of the document
sending a value back to the calling program.
9. A local variable is

Declared inside of the function definition
Not visible outside of the function
Only able to be accessed and modified inside of the block of code where it was created.
All of the above.
10. Global variables are declared outside of any function definition and are dangerous because they could be modified from any function.

True
False

Return to Top of Page | Back to Main Menu