Algorithms For Dummies


Creating reusable functions



Download 7,18 Mb.
Pdf ko'rish
bet163/651
Sana15.07.2021
Hajmi7,18 Mb.
#120357
1   ...   159   160   161   162   163   164   165   166   ...   651
Bog'liq
Algorithms

Creating reusable functions

You go to your closet, take out pants and shirt, remove the labels, and put them 

on.  At  the  end  of  the  day,  you  take  everything  off  and  throw  it  in  the  trash. 

Hmmm . . . that really isn’t what most people do. Most people take the clothes 

off, wash them, and then put them back into the closet for reuse. Functions are 

reusable, too. No one wants to keep repeating the same task; it becomes monoto-

nous and boring. When you create a function, you define a package of code that 

you can use over and over to perform the same task. All you need to do is tell the 

computer to perform a specific task by telling it which function to use. The com-

puter faithfully executes each instruction in the function absolutely every time 

you ask it to do so.

When you work with functions, the code that needs services from the function is 

named the caller, and it calls upon the function to perform tasks for it. Much of the 

information you see about functions refers to the caller. The caller must supply 

information to the function, and the function returns information to the caller.

At one time, computer programs didn’t include the concept of code reusability. As 

a result, developers had to keep reinventing the same code. It didn’t take long for 

someone to come up with the idea of functions, though, and the concept has 

evolved over the years until functions have become quite flexible. You can make 

functions do anything you want. Code reusability is a necessary part of applica-

tions to


Download 7,18 Mb.

Do'stlaringiz bilan baham:
1   ...   159   160   161   162   163   164   165   166   ...   651




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2025
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish