Calling Functions Flashcards
x = calculateOutput ( )
Does this statement call a function?
x = calculateOutput ( )
Yes, this is a proper statement calling a function.
newValue == calcOutput ( )
Does this statement call a function?
newValue == calcOutput ( )
No, this is NOT a proper function calling statement.
The == should be =
newValue = calcOutput (names)
Does this statement call a function?
newValue = calcOutput (names)
Yes, this is a proper statement calling a function.
DisplayOutput (names)
Does this statement call a function?
DisplayOutput (names) No, this is NOT a function calling statement. It looks like a module calling statement, but it is not in camelCase.
playerAlive = doBattle ( )
Does this statement call a function?
playerAlive = doBattle ( )
Yes, this is a proper statement calling a function.
x = calculateOUTPUT ( )
Does this statement call a function?
x = calculateOUTPUT ( )
No, this is NOT a function calling statement.
The function name is not in camelCase.
playerAlive = calcHealthValue (FALSE)
Does this statement call a function?
playerAlive = calcHealthValue (FALSE)
Yes, this is a proper statement calling a function.
answer = calculateAnswer
Does this statement call a function?
answer = calculateAnswer
No, this is NOT a function calling statement.
It is missing the ( )
newText = getString (enterMsg)
Does this statement call a function?
newText = getString (enterMsg)
Yes, this is a proper statement calling a function.
newArray = determineAnswer (myArray)
Does this statement call a function?
newArray = determineAnswer (myArray)
Yes, this is a proper statement calling a function.
Function void shootAlienShip ( )
Does this statement call a function?
Function void shootAlienShip ( )
No, this is NOT a function calling statement.
This is a function header.
sleepTime = nap (tenMinutes)
Does this statement call a function?
sleepTime = nap (tenMinutes)
Yes, this is a proper statement calling a function.
complete = finishJob (forMONEY)
Does this statement call a function?
complete = finishJob (forMONEY)
No, this is NOT a proper function calling statement because the argument is not in camelCase or UPPER_CASE to indicate it is a constant.
done = displayAwesomeGraphic ( )
Does this statement call a function?
done = displayAwesomeGraphic ( )
Yes, this is a proper statement calling a function.
Module Integer displayOutput ( )
Does this statement call a function?
Function Integer displayOutput ( )
No, this is NOT a function calling statement.
This is a function header.