WorksheetsProblem solving technique-Function
Total questions: 15
Worksheet time: 9mins
In a programming languages subroutines are called as ____
Function Specification
Functions
The variables in a function definition is called as _____.
Arguments
Parameters
Identifiers
The small sections of code that are used to perform a particular task is called
Files
Pseudo code
Subroutines
Modules
Which of the following is a unit of code that is often defined within a greater code structure?
Function
Files
Modules
Subroutines
Which of the following are mandatory to write the type annotations in the function definition?
Parantheses ( )
[ ]
{ }
indentations
The functions which will give exact result when same arguments are passed are called
Impure functions
Partial Functions
Dynamic Functions
Pure Functions
A set of action an object can do is (a)
A(n) (a) defines what an object can do but won't actually do it
_____ are expressed using statements of a programming language.
Function
Algorithm
Pseudo code
Function definition
Read the following code carefully and identify whether it is a normal function definition or recursive function.
let display( ):
print 'Hello Guys'
normal function
Recursive function
Read the following code carefully and identify whether it is a normal function definition or recursive function.
let rec pow a b:=
if b=0 then 1
else a*pow a (b-1)
Recursive function
Normal Function
In object oriented programs classes are the _____ and how the object is processed and executed is the _____.
implementation, interface
interface, implementation
A function definition which calls itself is called ____ .
Repetitive function
Looping function
Recursive function
If you want to define a recursive function , use the word_____ .
let
let rec
def
Function
Read the following code thoroughly and identify if it is pure or impure function.
let a:=random( )
if a>10 then
return: a
else
return: 10
Pure Function
Impure Function
