0% found this document useful (0 votes)
100 views

Tutorial - 1 and 2: Advanced Programming Language Concepts (CT006-3-3) Programming Paradigm

The document asks 6 questions about imperative and functional programming paradigms, including defining imperative programming, comparing it to functional programming, listing languages that support functional concepts, examining similarities and differences between the two paradigms, and how functional programming can be used in non-functional languages. It also provides a code example in Java and asks how the programming style compares to declarative/functional styles.

Uploaded by

Arvin Kovan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

Tutorial - 1 and 2: Advanced Programming Language Concepts (CT006-3-3) Programming Paradigm

The document asks 6 questions about imperative and functional programming paradigms, including defining imperative programming, comparing it to functional programming, listing languages that support functional concepts, examining similarities and differences between the two paradigms, and how functional programming can be used in non-functional languages. It also provides a code example in Java and asks how the programming style compares to declarative/functional styles.

Uploaded by

Arvin Kovan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Advanced Programming Language Concepts (CT006-3-3) Programming Paradigm

Tutorial -1 and 2
Question:
1. Define the imperative programming paradigm.
2. Compare imperative programming paradigm with functional programming paradigm.
3. List the programming languages support functional concepts.
4. Examine any FIVE (5) similarities and/ or differences between functional and imperative
programming paradigm.
5. Examine how the functional programming paradigm may be deployed in a programming
language that is fundamentally non-functional in nature. Provide suitable examples to
substantiate your answer.
6. Consider the following Java code.
import java.util.*;

public class Finder {


public static void main(String[] args) {
List<String> names =
Arrays.asList("Dory", "Gill", "Bruce", "Nemo");
findNemo(names);
}

public static void findNemo(List<String> names) {


boolean found = false;
for(String name : names) {
if(name.equals("Nemo")) {
found = true;
break;
}
}

if(found)
System.out.println("Found Nemo");
else
System.out.println("Sorry, Nemo not found");
}
}

Identify the programming style adopted in the above. Discuss how is this programming
style used comparatively with declarative/functional programming style. In the
discussion, the programming styles should be compared along with programming code,
respectively, in Java for the same problem.

Level 3 Asia Pacific University of Technology and Innovation Page 1 of 1

You might also like