Computer Science - Assignment No.1

Write the answers for the following questions (in computer science notebook /A4 Sheet) and submit the photo copy of the last page of your assignment with your parent signature.. 

Last Date : 23/04/2020 Time : 5.00pm

CHAPTER – 1 FUNCTION


2 - MARK Questions:

1. What is subroutine?
2. Define Algorithm.
3. Define Function with respect to Programming language.
4. Write the inference you get from X:=(78).
5. Differentiate interface and implementation.

3 - Marks
6. Which of the following is a normal function definition and which is
recursive function definition.
i) let rec sum x y:
return x + y
ii) let disp :
print ‘welcome’
iii) let rec sum num:
if (num!=0) then return num + sum (num-1)
else
return num
7. Mention the Characteristics of interface.
8. Why strlen is called pure function?
9. What is the side effect function of impure function? Give example.
10. Differentiate between Pure function and Impure function.
11. What happens if you modify a variable outside the function? Give an
example.

5 - Marks
12. What are called Parameters and write a note on
(i) Parameter without Type (ii) Parameter with Type
13. 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
14. Explain with example Pure and impure functions.
15. Explain with an example interface and implementation.

Last Date : 23/04/2020 Time: 5.00pm


click here to submit your completed assignment last page with parent signature....Click here!! 

Comments