Page 179 - Computer Science Class 11 With Functions
P. 179
8 INTRODUCTION TO
FUNCTIONS
Chapter Outline
8.1nBuilt-innfunctonon 8.2nUoer-definedn unctono
Introduction
Younmuotnhavenoeennoomeonendrivingnancar.nEvennthoughnancarnionancomplexnenttyncomprioingnhundredonofnpartonwhichn
makenitnmove,nthendriverndriveonitneaoilynwithnanhandfulnofncontrolonwhichnareneaoyntonmanage.nThenmanufacturingn
proceoonofnancarnionhighlynmodular.nItninvolveonmanufacturingnandnteotngnvariouoncarncomponentonatndifferentnancillaryn
unito.nSuboequently,ntheynarenaooemblednatnthenmainnunit.nThenmodularndeoignnofnthencarnmakeonthenproceoonofnfaultn
diagnooio,noervicingnandnmaintenanceneaoyntonmanage.
Juotn liken an car,n real-lifen programmingn taokon aren oftenn highlyn complex,n requiringn then efforton ofn oeveraln teamon ofn
programmeronfornoeveralnweeko,nmontho,nornyearo.nAonthencomplexitynofnanprogrammingntaoknincreaoeo,noondoeonthen
lengthnandncomplexitynofnthenaooociatednprogramo,nmakingnitndifficultntonunderotand,nmanage,nandndebug.nTonmanagen
anlargenprogramnfornoolvingnancomplexnproblem,nwenoftenndividenthenproblemnintonoubproblemonandnoolveneachnoub-
problemnbynanoub-programn(module).nIfnanoubproblemnionotllnveryncomplex,nitnmaynbenfurtherndividednintonoubproblemo.n
Thenproceoonofndividingnancomplexnproblemnintonoimplenandnmanageablenproblemonioncallednotepwioenrefinement.nItn
oaveonanlotnofntmenandneffort.nThenprogrammingnmethodologynthatnfocuoeononnorganioingnancomputernprogramninton
oeparatenblockonofncodenornoub-programon(eachnhavingnannamenandnfunctonality)nioncallednmodular programming.nEachn
independentnunitnofncodenioncallednanmodule.nInnthencontextnofnPython,nanprogramnfilenionalooncallednanmodulenornanocript.n
Thionchapternwillndiocuoonthenmodularnapproachntondevelopingnprogramo.n
Introductonnton unctono 177

