Lec 18- Functions-I

Lec 18- Functions-I - Lecture 18 Functions Course...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
FAST, National University of Computer and Emerging Sciences, Islamabad Lecture 18: Functions Course: Programming For Engineers-1 Asma Ahmad
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Introduction The basic constructs of programming are sequence, decision making and loops. You have learnt all these techniques. There are more techniques to further refine the programs. One of the major programming constructs is Functions
Background image of page 2
Introduction In our daily life, we divide our tasks into sub tasks. Consider the making of a laboratory stool.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
How to make this stool? It has a seat and three legs. The major task is to make a stool. Sub tasks are, make a seat and then fabricate three legs. The legs should be identical.
Background image of page 4
Making Lib Stool (contd. .) We can fashion one leg and then re-using this prototype, we have to build two more identical legs The last task is to assemble all these to make a stool We have a slightly difficult task and have broken down it into simpler pieces. This is the concept of functional design or top-down designing.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Top Down Design In top design, we look at the problem from top i.e. identification of the problem. What we have to solve? Then refine it and divide it into smaller pieces. We refine it again and divide it into smaller pieces. We keep on doing it as long as we get easily manageable task.
Background image of page 6
Another Example: Home Construction From the top level, we have to construct a home. Then we say that we need design of the home
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 26

Lec 18- Functions-I - Lecture 18 Functions Course...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online