Function Headers Flashcards
Function Integer calculateOutput ( )
Is this a proper function header?
Function Integer calculateOutput ( )
Yes, this is a valid function Header.
Function Boolean calcOutput (names)
Is this a proper function header?
Function Boolean calcOutput (names)
Yes, this is a valid function Header.
Function Real displayOutput (names, points)
Is this a proper function header?
Function Real displayOutput (names, points)
Yes, this is a valid function Header.
Function void displayOutput (names, points)
Is this a proper function header?
Function void displayOutput (names, points)
No, this is NOT a valid function Header.
Functions return a value. Void is not valid in a function header in pseudocode.
Function Real GetReal (String message)
Is this a proper function header?
Function Real GetReal (String message)
No, this is NOT a valid function Header.
The function name is not in camelCase.
Function Real getReal (String message)
Is this a proper function header?
Function Real getReal (String message)
Yes, this is a valid function Header.
Function Real Real getReal (String message)
Is this a proper function header?
Function Real Real getReal (String message)
No, this is NOT a valid function Header.
It has an extra return variable type.
Function Boolean shootAlienShip ( )
Is this a proper function header?
Function Boolean shootAlienShip ( )
Yes, this is a valid function Header.
Function shootAlienShip ( ) Is this a proper function header?
Function shootAlienShip ( ) No, this is NOT a valid function Header. It is missing a return variable type.
Function Real determineOutput ( )
Is this a proper function header?
Function Real determineOutput ( )
Yes, this is a valid function Header.
x = determineOutput ( )
Is this a proper function header?
x = determineOutput ( )
No, this is NOT a valid function Header.
It is a function calling statement.
Function getInteger (String message) Is this a proper function header?
Function getInteger (String message) No, this is NOT a valid function Header. It is missing the return variable type.
Function Integer getInteger (String message)
Is this a proper function header?
Function Integer getInteger (String message)
Yes, this is a valid function Header.
Function Real determineOutput (String)
Is this a proper function header?
Function Real determineOutput (String)
No, this is NOT a valid function Header.
The parameter list is missing the variable name.
Function Integer getReal (message)
Is this a proper function header?
Function Integer getReal (message)
No, this is NOT a valid function Header.
The parameter list is missing the variable type.