Quiz6-Functions Flashcards
Library functions are built into a programming language and can be called whenever they are needed.(T/F)
True
The input column in an IPO chart describes the process that the function performs on input data.(T/F)
False
Many programming languages let you assign an integer value to a real variable without causing an error(T/F)
True
Random numbers are useful in simulation programs where the computer must randomly decide how an object will behave(T/F)
True
The function body follows the function header in a function definition.(T/F)
True
The TO INTEGER function accepts a real number as its argument and preserves any fractional part in the returned number.(T/F)
False
When a function finishes executing, it returns a value back to the part of the program that called it.(T/F)
True
If the string variable name has the value “Anne Marie”, then the following statement would return 9: (T/F)
Set number = length(name)
False
If the string variable name has the value “Anne.Smith”, then the following statement would return annesmith. (T/F)
Set newName = toLower(name)
False
If the integer variable number has the value 5, then the following statement would return 25 to result.(T/F)
Set result = sqrt(number)
False: sqrt(5) would not be 25
Given an integer variable number, the only possible values for number that could result from the following statement are 1 and 2.
Set number = random(0,2)
False
The following pseudocode would display: Hello, friend. (T/F)
Declare String str1=”Hello,”
Declare String str2=” friend”
Set message = append(str1,str2)
Display message
True
A function ___________ specifies the return data type, name of the function and the parameter variable(s).
header
Which function accepts two strings as arguments and returns TRUE if the second string is contained in the first string or FALSE if not?
contains
Which function returns a string that is within another string?
substring