Intro to Functions / Parameters
a day ago
allanortiz44
Save
Edit
Host a game
Live GameLive
Homework
Solo Practice
Practice
• Question 1
30 seconds
Q.

What two things must one do in order to create a function?

Define the function

Call the function

Give the function a value inside the Parameter

• Question 2
30 seconds
Q.

How do you debug the following piece of code?

makeSquare(20);

function makeSquare (20) ;{

mF(size);

tL();

mF(size);

tL();

mF(size);

tL();

mF(size);

tL();

}

Replace "size" with the number 20 for all the "mF" commands

Replace the parameter inside the function definition of "makeSquare" with the word "size"

The code will works and does not need debugging.

Replace the parameter inside the call to "makeSquare" with the word "size"

• Question 3
30 seconds
Q.

What is another word for an abstraction?

Command

Parameter

Function

Debugging

• Question 4
30 seconds
Q.

What is the reason we use parameters?

To create a lot of functions

To make is easier for the user to input values when playing a game.

To be able to go back and fix error in the code and make it easier to debug.

To modify existing function and make them easier to customize or change when being called.

• Question 5
30 seconds
Q.

What is another word for a function?

Function

Abstraction

Command

To Call

• Question 6
30 seconds
Q.

What is the error in the following code?

function drawLine();{

mF();

mF();

mF();

}

The function is not being called

There is no function definition

There are no parameters

"mF" is not being called

• Question 7
30 seconds
Q.

If I want to make a function I must add parameters.

True

False

• Question 8
30 seconds
Q.

Abstractions are simplified versions of something more complex

True

False

It depends what coding language you are using.

• Question 9
30 seconds
Q.

What word is used for correcting errors in a code.

Bugging

Seeking and Fixing

Corrections

Debugging

• Question 10
30 seconds
Q.

Functions make coding more efficient.

True

False

• Question 11
30 seconds
Q.

How many parameters can I add to a function.