Question: 4(a) Explain the difference between compilation and interpretation. What are the advantages and disadvantages of the two approaches? (8 marks) (b) Give a short

4(a) Explain the difference between compilation and interpretation. What are the advantages and disadvantages of the two approaches? (8 marks) (b) Give a short overview of the main characteristics of the following programming paradigms. In each case give an example of a programming language that follows the paradigm. 1) Imperative 2) Logical and 3) Object-oriented. (12 marks) (c) One of the features of functional programming languages is higher-order functions. Describe what a higher-order function is. (3 marks) (d) Write a program in Haskell that given the following list of numbers (-1, 2, -3, 4, -5), prints the squares of the even numbers. (7 marks)
Step by Step Solution
There are 3 Steps involved in it
a Compilation vs Interpretation Compilation Compilation is the manner of translating the whole supply code into device code or an intermediate languag... View full answer
Get step-by-step solutions from verified subject matter experts
