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

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

    answer choices

    Define the function

    Call the function

    Add a Parameter

    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();

    }

    answer choices

    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?

    answer choices

    Command

    Parameter

    Function

    Debugging

  • Question 4
    30 seconds
    Q.

    What is the reason we use parameters?

    answer choices

    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?

    answer choices

    Function

    Abstraction

    Command

    To Call

  • Question 6
    30 seconds
    Q.

    What is the error in the following code?


    function drawLine();{

    mF();

    mF();

    mF();

    }

    answer choices

    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.

    answer choices

    True

    False

  • Question 8
    30 seconds
    Q.

    Abstractions are simplified versions of something more complex

    answer choices

    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.

    answer choices

    Bugging

    Seeking and Fixing

    Corrections

    Debugging

  • Question 10
    30 seconds
    Q.

    Functions make coding more efficient.

    answer choices

    True

    False

  • Question 11
    30 seconds
    Q.

    How many parameters can I add to a function.

    answer choices

    1

    3

    2

    255

Report Quiz
Join a game