Intro to Coding - Functions, Procedures, Arguments and Parameters

Ace your homework & exams now with Quizwiz!

This term, often used interchangeably with the term parameter, is the data that is passed into the parameter itself. A. a function B. an argument C. a routine D. a variable

B. an argument

What does a constant do in relation to a value? A. A constant causes a value to exit. B. A constant eliminates a value. C. A constant replaces a value. D. A constant passes a variable to a value.

C. A constant replaces a value.

What does a function return? A. a procedure B. a routine C. a value D. a subroutine

C. a value

Which of the following describe a required argument? Check all that apply. A. an argument that does not need to be specified B. an argument defined by its parameter name C. an argument passed to the function in the correct positional order D. an argument wherein the number of arguments in the function call should match the definition of the function

C. an argument passed to the function in the correct positional order D. an argument wherein the number of arguments in the function call should match the definition of the function

How is a procedure different than a function? A. A function is a subroutine, while a procedure is a parameter. B. A procedure and a function are the same thing. C. A procedure returns a value, while a function does not. D. A procedure does not return a value, while a function does.

D. A procedure does not return a value, while a function does.

Which of the following describes a default argument? A. an argument that allows you to skip an argument B. an argument passed to the function in the correct positional order C. an argument that can be called by parameter name D. an argument that does not need to be specified

D. an argument that does not need to be specified

What is a return statement used for? A. beginning a function B. repeating a value C. copying a function D. exiting a function

D. exiting a function

Using the drop-down menu, complete the following questions based on your knowledge of variables. A. ________ is a value that can be used only from a block of code where it is declared. B. ________ is a storage location for a value. C. ________ is a value that can be called and used anywhere.

A. A local variable B. A variable C. A global variable

Which of the following is true of a procedure? Check all that apply. A. It can be reused. B. It saves programmers time. C. It is a block of code that performs a single task. D. It lets you exit a function.

A. It can be reused. B. It saves programmers time. C. It is a block of code that performs a single task.

Which of the following is true of a constant? Choose all that apply. A. It cannot be changed by the program as it runs. B. It is a data type. C. It is a procedure in a block of code. D. It can be changed by the program as it runs.

A. It cannot be changed by the program as it runs. B. It is a data type.

Which of the following are benefits of the Python programming language? Check all that apply. A. It is free to use. B. It saves programmers time. C. It is known for its symbols. D. It is relatively easy to learn.

A. It is free to use. B. It saves programmers time. D. It is relatively easy to learn.

Which of the following statements is true of subroutines? Check all that apply. A. They can be used in multiple places. B. They can be used in one place only. C. They save a programmer time since D. they are reusable. E. They can be used only once. F. They can contribute to excessive use of a computer's resources.

A. They can be used in multiple places. C. They save a programmer time since F. They can contribute to excessive use of a computer's resources.

Which of the following correctly defines a function in computer programming? Choose all the apply. A. a code block that performs a single task B. a code block that returns a value C. a value that can be used anywhere in a code block D. data in code that is passed into a parameter

A. a code block that performs a single task B. a code block that returns a value

Which of the following correctly defines a procedure in computer programming? Choose all the apply. A. a code block that performs a single task B. a value that can be used anywhere in a code block C. a code block programmers can reuse multiple times D. data in code that is passed into a parameter

A. a code block that performs a single task C. a code block programmers can reuse multiple times

A subroutine may be used to refer to which of the following? Check all that apply. A. a function B. a subprogram C. a procedure D. a method E. a variable

A. a function B. a subprogram C. a procedure D. a method

What is a special type of variable used in subroutines that refers to a piece of data? A. a parameter B. a constant C. a function D. a routine

A. a parameter

Which of the following defines code? A. a set of instructions, written by a programmer, that is used by computers to perform tasks B. data that a program expects to be supplied C. a procedure that returns a value as a result D. data that is passed to a parameter in a program

A. a set of instructions, written by a programmer, that is used by

Which of the following describe a keyword argument? Check all that apply. A. an argument in which the caller identifies it by parameter name B. an argument that does not need to be specified C. an argument describes the function D. an argument in which order of arguments does not matter

A. an argument in which the caller identifies it by parameter name D. an argument in which order of arguments does not matter

Using the drop-down menu, complete these sentences about arguments. A. The ________ identifies the argument by parameter name. B. The ________ does not need to be specified in the function. C. A ________ is passed to a function in the correct positional order.

A. keyword argument B. default argument C. required argument

Use the drop-down menu to complete these sentences about variables. A. A ________ is a value that can be used only from the block of code where it is declared. B. A ________ variable is a storage location for a value. C. A ________ is a value that can be called and used anywhere.

A. local variable B. variable C. global variable

Which of the following are advantages of using subroutines? Choose all that apply. A. Subroutines return multiple variables when used as a function. B. Subroutines allow the programmer to save time. C. Subroutines eliminate duplicate code. D. Subroutines provide a fixed value that cannot be changed.

B. Subroutines allow the programmer to save time. C. Subroutines eliminate duplicate code.


Related study sets

Endocrine System: Parathyroid Glands

View Set

NUFD404 Additional stuff for final exam

View Set

Adobe CC Photoshop: Project Setup and Interface

View Set

Ch. 19 - Geography and the Early Settlement of China

View Set

Foundations of Nursing Study Guide 4

View Set

AP human geography: Most missed questions for the final

View Set

TRAUMA, BURNS, NEURO QUESTIONS - EXAM 4

View Set

Chapter 1: The Nurse's Role in Health Assessments

View Set

Chapter 36 NANOFABRICATION TECHNOLOGIES

View Set