U2L3 #1 [Writing Functions]

U2L3 #1 [Writing Functions]

Assessment

Flashcard

Computers

12th Grade

Hard

Created by

Harold Peaden

FREE Resource

Student preview

quiz-placeholder

12 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Does this code snippet correctly define and call the function?

Back

Yes, this code snippet correctly defines and calls the function.

2.

FLASHCARD QUESTION

Front

Does this code snippet correctly define a function?

Back

This code snippet has an error.

Answer explanation

You do not begin a function definition with the word function. You start the definition of a function with func.

3.

FLASHCARD QUESTION

Front

Does this code snippet correctly define a function?

Back

Yes, this code snippet correctly defines a function.

4.

FLASHCARD QUESTION

Front

Does this code snippet correctly define and call the function?

Back

Yes, this code snippet correctly defines and calls the function.

5.

FLASHCARD QUESTION

Front

Does this code snippet correctly define and call the function?

Back

This code snippet has an error.

Answer explanation

This attempts to pass parameters to a function that accepts no parameters.

6.

FLASHCARD QUESTION

Front

Does this code snippet correctly define and call the function?

Back

Yes, this code snippet correctly defines and calls the function.

7.

FLASHCARD QUESTION

Front

Does this code snippet correctly define and call the function?

Back

This code snippet has an error.

Answer explanation

This is invalid because id is not defined anywhere.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?