0% found this document useful (0 votes)
43 views4 pages

Comsats Institute of Information Technology: Department of Computer Sciences

The document summarizes key aspects of structured, modular, and functional programming paradigms: Structured programming emphasizes logical sequencing, selection, and loops. Modular programming breaks programs into independent, reusable modules. Functional programming treats computation as mathematical function evaluation without variables. Similarities include both structured and modular programming using variables and top-down design. Differences are functional programming often lacks variables and uses lambda calculus while the others don't. Modular uses modules while structured uses control structures. Merits of structured programming include logical problem-solving and clear flow control, while lacking reusability. Modular programming allows collaboration and isolated error-fixing but risks from module linking. Functional programming is architecture independent but w

Uploaded by

Moazzam Hameed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views4 pages

Comsats Institute of Information Technology: Department of Computer Sciences

The document summarizes key aspects of structured, modular, and functional programming paradigms: Structured programming emphasizes logical sequencing, selection, and loops. Modular programming breaks programs into independent, reusable modules. Functional programming treats computation as mathematical function evaluation without variables. Similarities include both structured and modular programming using variables and top-down design. Differences are functional programming often lacks variables and uses lambda calculus while the others don't. Modular uses modules while structured uses control structures. Merits of structured programming include logical problem-solving and clear flow control, while lacking reusability. Modular programming allows collaboration and isolated error-fixing but risks from module linking. Functional programming is architecture independent but w

Uploaded by

Moazzam Hameed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COMSATS INSTITUTE OF

INFORMATION TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCES


PROGRAMMING FUNDAMENTALS

Moazzam Hameed Paracha


FA16-BCS-021
16 / 2 / 2017
Class 2 A
Question 1:
Discuss principles of Structured, Modular and Functional Programming?

Answer:

 Structured
Structured programming helps code in a systematic and organized manner.
It combines the principles of top-down design, and, modularity. It has three
fundamental elements. Sequencing, meaning each step must logically must
progress in a logical manner without any undesired effects. Selection,
basically by applying specific conditions using if or else statements. The
third beings loops, by using for or while statements to tell how long a piece
of code is to be contentiously executed.

 Modular programming
Modular programming is simply a programming technique which
emphasizes separating the functionality of a programming into
independent interchangeable modules. Modules being small chunks of
code which help lessen the complexity of a program and allow for
reusability of code. It uses the system of top-down design.

 Functional programming
In Functional programming, the computation is treated as the evaluation of
mathematical functions and avoids using variables and mutable data,
primarily based on a theoretical framework like lambda calculus. It is a type
of Declarative Programming. Some examples of Functional Programming
are Lisp and Haskell.

QUESTION 2:
Highlight similarities and dissimilarities between them.
ANSWER:

SIMILARITIES:

 Both Structured Programming and Modular programming use the top-


down design.
 Both Structured and Modular use variables.

DISSIMILARITIES:

 Functional Programming often has no variables while both modular and


structured programming do.
 Functional Programming uses mathematic like lambda calculus as a means
of coding while both Structured and Modular do not.
 Modular Programming uses modules whereas Structured uses functions and
control structures like if statements and loops

QUESTION 3:
Merits and demerits of the 3 paradigms.

ANSWER:

 Structured Programming:
It is less complex, it uses modularity thus allowing complex problems to be
solved logically by being broken down into small chunks or steps and be
solved more easily. Also using it makes the flow of control clear.
Its demerits include lack of reusability of code and using of top-down
method, thus restricting it to always starting from the top.

 Modular Programming:
Since it uses modules for making programming, more than one
programmer can work on it at a time. Errors can be easily solved since only
the module will need to be fixed instead of the whole program.
Its demerits are that any mistake in linking multiple modules together can
lead to an error. Modules must be properly documented or else it can lead
to more problems.

 Functional Programming
Functional programming is architecture independent. Users with a
mathematical background find it easier to use.
Since it doesn’t use any memory, each calculation must be carried out
multiple times, hence wasting the computers processing time.

You might also like