Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Problem solving technique-Function

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

In a programming languages subroutines are called as ____

a)

Function Specification

b)

Functions

2.

The variables in a function definition is called as _____.

a)

Arguments

b)

Parameters

c)

Identifiers

3.

The small sections of code that are used to perform a particular task is called

a)

Files

b)

Pseudo code

c)

Subroutines

d)

Modules

4.

Which of the following is a unit of code that is often defined within a greater code structure?

a)

Function

b)

Files

c)

Modules

d)

Subroutines

5.

Which of the following are mandatory to write the type annotations in the function definition?

a)

Parantheses ( )

b)

[ ]

c)

{ }

d)

indentations

6.

The functions which will give exact result when same arguments are passed are called

a)

Impure functions

b)

Partial Functions

c)

Dynamic Functions

d)

Pure Functions

7.

A set of action an object can do is (a)  

8.

A(n) (a)   defines what an object can do but won't actually do it

9.

_____ are expressed using statements of a programming language.

a)

Function

b)

Algorithm

c)

Pseudo code

d)

Function definition

10.

Read the following code carefully and identify whether it is a normal function definition or recursive function.

let display( ):

print 'Hello Guys'

a)

normal function

b)

Recursive function

11.

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)

a)

Recursive function

b)

Normal Function

12.

In object oriented programs classes are the _____ and how the object is processed and executed is the _____.

a)

implementation, interface

b)

interface, implementation

13.

A function definition which calls itself is called ____ .

a)

Repetitive function

b)

Looping function

c)

Recursive function

14.

If you want to define a recursive function , use the word_____ .

a)

let

b)

let rec

c)

def

d)

Function

15.

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

a)

Pure Function

b)

Impure Function