New ! Computer Science MCQ Practise Tests



Function Model Question Paper 1

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 50
    5 x 1 = 5
  1. Which of the following is a unit of code that is often defined within a greater code structure?

    (a)

    Subroutines

    (b)

    Function

    (c)

    Files

    (d)

    Modules

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

    (a)

    Curly braces

    (b)

    Parentheses

    (c)

    Square brackets

    (d)

    indentations

  3. Which of the following carries out the instructions defined in the interface?

    (a)

    Operating System

    (b)

    Compiler

    (c)

    Implementation

    (d)

    Interpreter

  4. The function definition is introduced by the keyword

    (a)

    def

    (b)

    rec

    (c)

    let

    (d)

    infer

  5. The recursive function is defined using the keyword

    (a)

    let

    (b)

    let rec

    (c)

    name

    (d)

    infer

  6. 5 x 2 = 10
  7. What is a subroutine?

  8. Write the inference you get from X : = (78).

  9. Give an example of function definition parameter without type.

  10. Give an example of function definition parameter with type.

  11. Give an example of impure function.

  12. 5 x 3 = 15
  13. Why strlen is called pure function?

  14.  What is the side effect of impure function. Give example.

  15. Wha happens if you modify a variable outside the function? Give an example.

  16. Explain the syntax of function definitions.

  17. Write a short note an syntax for function types.

  18. 4 x 5 = 20
  19. What are called Parameters and write a note on
    (i) Parameter without Type
    (ii) Parameter with Type

  20. Identify in the following program
    let rec gcd a b:=
               if b <> 0 then gcd b (a mod b)
               else return a:
    i) Name of the function
    ii) Identify the statement which tells it is a recursive function
    iii) Name of the argument variable
    iv) Statement which invoke the function recursively
    v) Statement which terminates the recursion

  21. Explain with example Pure and impure functions.

  22. Explain with an example interface and implementation.

*****************************************

Reviews & Comments about 12th Computer Science - Function Model Question Paper 1

Write your Comment