Methods of Algorithm Description Second Edition to accompany the



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

Problem Solving and Computer Programming, Peter Grogono & Sharon H Nelson, © 1982 Addison-Wesley Publishing Company Inc. Reproduced by the permission of the publisher.Overview of Two Methods 11

Pseudocode Guidelines 11

Flowchart Elements 13

It is considered good practice for a single flowchart never to exceed the bounds of one page. If a flowchart does not fit on one page, this is one instance in which the better solution is to use refinement which results in the creation of subprograms. Subprograms on separate pages are more desirable than using a connector to join flowcharts over more than one page. A flowchart expressing the solution to an involved problem may have the main program flowchart on one page with subprograms continuing the problem solution on subsequent pages. An example of this situation is given in the last solved problem in this document — the Auto Teller problem on page 54.Programming Structures 14

An Example Using Sequence 17

Pseudocode 17

Flowchart 18

Binary Selection 18

Multi-way Selection 21

Examples Using Binary Selection 22

7TN Pseudocode 22

Flowchart 22

Pseudocode 22

Flowchart 22

An Example Using Multi-way Selection 23

Pseudocode 23

Flowchart 23

Repetition: Pre-Test 23

Repetition: Post-Test 25

An Example Using Pre-Test Repetition 25

Pseudocode 26

Flowchart 27

An Example Using Post-Test Repetition 27

Pseudocode 27

Flowchart 27

Example of Using Subprograms in Pseudocode 30

Example of Using Subprograms with one Parameter in Pseudocode 32

Solved ProblemsTable Indicating Programming Structures Used in the Sample Problems 2

Lift Problem 3

Pseudocode 3

Flowchart 3

73^ Pseudocode 4

Temperature Control Problem 5

TZiS Pseudocode 5

Toll Gate Problem 8

Pseudocode 9

Subprogram 11

'Squash' Scoring Problem 13

Pseudocode 13

Subprogram 15

Record Separation Problem 16

7TN Pseudocode 17

7TN Pseudocode 20

73^ Pseudocode 23

Flowchart 24

Guess the Number Problem 25

7TN Pseudocode 26

Subprogram 28

Income Tax Problem 30

Pseudocode 30

Another valid method of solving this problem is to use the multiple selection or ‘case’ structure.Telephone Dialler Problem 32

TTN Pseudocode 33

Subprogram 36

Auto Teller Problem 37

7TN Pseudocode 38

Subprograms 43

Algorithms for Searching 2

Pseudocode 3

Flowchart 4

General Idea of the Algorithm 5

7TN Pseudocode 6

END SUBPROGRAM calculate the Middle positionAlgorithms for Sorting 7

General Idea of the Algorithm 7

7TN Pseudocode 8

General Idea of the Algorithm 9

Pseudocode 9

General Idea of the Algorithm 12

Pseudocode 13

Flowchart 14


An algorithm consists of a set of explicit and unambiguous finite steps which, when carried out for a given set of initial conditions, produce the corresponding output and terminate in finite time.

How to Solve it by Computer, RG Dromey, Prentice Hall UK, 1982


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