Chapter 5 Quiz Questions

Your page rank:

Total word count: 1163
Pages: 4

Calculate the Price

- -
275 words
Looking for Expert Opinion?
Let us have a look at your work and suggest how to improve it!
Get a Consultant

What is a GROUP OF STATEMENTS that exists within a program for the purpose of performing a specific task?

Function

The FIRST LINE in the function definition is known as the function _____.

Header

The _____ DESIGN technique can be used to break DOWN an algorithm into functions.

Top Down Design

A set of statements that BELONG TOGETHER AS A GROUP and contribute to the function definition is known as a(n) _____.

Block

A(n) _____ chart is also known as a structured CHART.

Hierarchy

A(n) _____ variable is created INSIDE a function.

Local

The _____ of a local variable is the function in which the VARIABLE IS CREATED.

Scope

A(n) _____ is any piece of data that is PASSED INTO A FUNCTION when the function is called.

Argument

A(n) _____ is a variable that RECEIVES AN ARGUMENT that is passed into a function.

Parameter

The _____ argument SPECIFIES which parameter the argument should be passed into.

Keyword

A(n) _____ variable is ACCESSIBLE TO ALL the functions in a program file.

Global

A(n) _____ constant is a GLOBAL name that references a value that cannot be changed.

Global

When a function is called by its name, then it is _____.

Executed

It is recommended that programmers should AVOID USING _____ variables in a program when possible.

Global

A variable’s _____ is the part of a program in which the VARIABLE MAY BE ACCESSED.

Scope

The Python library functions that are BUILT INTO the Python _____ can be used by simply calling the function.

Interpreter

Python comes with _____ functions that have been ALREADY PREWRITTEN for the programmer.

Standard

Which of the following statements causes the interpreter to load the contents of the RANDOM MODULE into memory?

Import Random

Which of the following will assign a random number in the range of 1 through 50 to the variable number?

number = random.randint(1, 50)

What is the result of the following statement?

x = random.randint(5, 15) * 2

A random integer from 5 to 15, multiplied by 2, assigned to the variable x

What type of value is returned by the functions RANDOM AND UNIFORM?

Float

In a VALUE-RETURNING function, the value of the expression that follows the key word _____ will be sent back to the part of the program that called the function.

Return

What type of function can be used to determine whether a number is EVEN OR ODD?

Boolean

The Python standard library’s _____ module contains numerous functions that can be used in MATHEMATICAL calculations.

Math

Which of the following functions returns the LARGEST INTEGER that is less than or equal to x?

Floor

What makes it easier to REUSE THE SAME CODE in more than one program?

Modules

In a MENU-DRIVEN program, what statement is used to determine and carry out the user’s desired action?

if-elif-else

A VALUE-RETURNING function is _____.

a function that will return a VALUE BACK to the part of the program that called it

What does the following statement mean?
num1, num2 = get_num()

The function get_num() is expected to return a value each for num1 and num2.

Given the following function definition, what would the statement print magic(5) display?
def magic(num):
return num + 2 * 10

25

True/False: PYTHON function names follow the same rules for naming variables.

True

True/False: The function header marks the beginning of the function definition.

True

True/False: A function definition SPECIFIES what a function does and causes the function to execute.

False

True/False: The HIERARCHY chart shows all the steps that are taken inside a function.

False

True/False: A LOCAL VARIABLE can be accessed from anywhere in the program.

False

True/False: DIFFERENT functions can have local variables with the SAME NAMES.

True

True/False: Python allows for passing MULTIPLE ARGUMENTS to a function.

True

True/False: To assign a value to a global variable in a function, the global variable must first be DECLARED in the function.

True

True/False: The value assigned to a global constant can be changed in the MAINLINE LOGIC.

True

True/False: One of the reasons not to use global variables is that it makes a program hard to DEBUG.

True

True/False: A value-returning function is like a SIMPLE FUNCTION EXCEPT that when it finishes it returns a value back to the called part of the program.

True

True/False: BOOLEAN functions are useful for simplifying complex conditions that are tested in decision and REPETITION structures.

True

True/False: Unlike other languages, IN PYTHON, the number of values a function can return is limited to one.

False

True/False: IN PYTHON, one can have a list of variables on the left side of the assignment operator.

True

True/False: IN PYTHON, there is no restriction on the name of a module file.

True

True/False: The RANDRANGE function returns a randomly selected value from a specific sequence of numbers.

True

True/False: One of the drawbacks of a MODULARIZED program is that the only structure we could use is sequence structure.

False

True/False: In a MENU-DRIVEN program, a loop structure is used to determine the menu item the user selected.

False

True/False: The math function, ATAN(x), returns one tangent of x in radians.

False

True/False: The math function, CEIL(x), returns the smallest integer that is greater than or equal to x.

True

The APPROACH called _______________ is taking a large task and dividing it into several smaller tasks that are easily performed.

divide and conquer

The code for a function is known as a function _______________.

definition

The function header BEGINS WITH the keyword _______________ followed by the name of the function.

def

The MAIN function contains a program’s _______________ logic, which is the overall logic of the program.

mainline

In a flowchart, a function call is depicted by a(n) _______________ that has VERTICAL BARS.

rectangle

The top-down design BREAKS DOWN the overall task of the program into a series of _______________.

subtasks

A(n) _______________ chart is a VISUAL REPRESENTATION of the relationships between functions.

hierarchy

Arguments are passed by _______________ to the corresponding PARAMETER variables in the function.

position

A variable is VISIBLE only to statements in the variable’s _______________.

scope

Functions in the standard LIBRARY are stored in files that are known as _______________.

modules

The term _______________ is used to describe any mechanism that accepts input, performs some operation that CANNOT BE SEEN, and produces output.

black box

To refer to a function in a module, in our program we have to use the _______________ NOTATION.

dot

A VALUE-RETURNING function has a(n) _______________ statement that returns a value back to the part of the program that called it.

return

The _______________ chart is an effective tool that programmers use for DESIGNING AND DOCUMENTING functions.

IPO

The ‘P’ in the acronym IPO refers to _______________.

processing

In Python, a module’s file name should end in _______________

.py

A(n) _______________ program displays a list of the operations on the screen and allows the user to SELECT THE OPERATION that the program should perform.

menu-driven

The APPROACH of _______________ makes the program easier to understand, test, and maintain.

modularization

The return values of the TRIGonometric functions in Python are in _______________.

radians

Share This
Flashcard

More flashcards like this

NCLEX 10000 Integumentary Disorders

When assessing a client with partial-thickness burns over 60% of the body, which finding should the nurse report immediately? a) ...

Read more

NCLEX 300-NEURO

A client with amyotrophic lateral sclerosis (ALS) tells the nurse, "Sometimes I feel so frustrated. I can’t do anything without ...

Read more

NASM Flashcards

Which of the following is the process of getting oxygen from the environment to the tissues of the body? Diffusion ...

Read more

Unfinished tasks keep piling up?

Let us complete them for you. Quickly and professionally.

Check Price

Successful message
sending