Methods of Algorithm Description Second Edition to accompany the


Problem: Write a set of instructions that describe how to make a pot of tea. Pseudocode



Download 110,98 Mb.
bet6/17
Sana31.12.2021
Hajmi110,98 Mb.
#240246
1   2   3   4   5   6   7   8   9   ...   17
Bog'liq
ddddddddddd

Problem: Write a set of instructions that describe how to make a pot of tea.

Pseudocode



BEGIN

fill a kettle with water boil the water in the kettle put the tea leaves in the pot pour boiling water in the pot END





Flowchart




S
Selection
election is used in a computer program or algorithm to determine which particular step or set of steps is to be executed. A selection statement can be used to choose a specific path dependent on a condition. There are two types of selection: binary (two-way branching) selection and multi-way (many way branching) selection. Following is a description of each.

Binary Selection



As the name implies, binary selection allows the choice between two possible paths. If the condition is met then one path is taken, otherwise the second possible path is followed. In each of the examples below, the first case described requires a process to be completed only if the condition is true. The process is ignored if the condition is false. In other words there is only one path that requires processing to be done, so the processing free path is left out rather than included saying ‘do nothing’.

TT2N In pseudocode, binary selection is expressed in the Jss following ways:

~ 1. IF condition THEN

process 1

ENDIF

2. IF condition THEN process 1

ELSE process 2

ENDIF


B



In flowcharts, binary selection is expressed in the following ways:




2.




Note: In a flowchart it is most important to indicate which path is to be followed when the condition is true, and which path to follow when the condition is false. Without these indications the flowchart is open to more than one interpretation.


Download 110,98 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   17




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
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