Lec 18- Functions-I

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

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

FAST, National University of Computer and Emerging Sciences, Islamabad Lecture 18: Functions Course: Programming For Engineers-1 Asma Ahmad

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

View Full Document
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
Introduction In our daily life, we divide our tasks into sub tasks. Consider the making of a laboratory stool.

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

View Full Document
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.
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.

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

View Full Document
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.
Another Example: Home Construction From the top level, we have to construct a home. Then we say that we need design of the home

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

View Full Document
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
Ask a homework question - tutors are online