0% found this document useful (0 votes)
65 views59 pages

Chapter 5

The document discusses flowchart techniques used in programming. It defines flowcharts and their purpose in representing program logic visually. Standard flowchart symbols like terminals, input/output, processing, decision diamonds, and connectors are described along with examples.

Uploaded by

22342as
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views59 pages

Chapter 5

The document discusses flowchart techniques used in programming. It defines flowcharts and their purpose in representing program logic visually. Standard flowchart symbols like terminals, input/output, processing, decision diamonds, and connectors are described along with examples.

Uploaded by

22342as
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

‫‪.

‬‬

‫الفصل اخلامس‬
‫خرائط التذفق‬

‫‪-102-‬‬
‫مـحتويات البـــاب الخامس‬
‫• تعريف المشكلة ) ‪( Problem Definition‬‬

‫• حل المشكالت )‪(Problem Solving‬‬

‫• مراحل حل مشكلة )‪(Problem Solving Stages‬‬

‫• خطوات حل المشكلة ( الخوارزمية « ‪)» Algorithm‬‬

‫• خرائط التدفق )‪ (Flow Chart‬تعبرعن خطوات الحل‪.‬‬

‫• استخدام التفرع (إتخاذ القرار ‪( Decision‬في خرائط التدفق‪.‬‬

‫• استخدام الحلقات التكرارية )‪ ) LOOP‬في خرائط التدفق‬


Flowchart Techniques

1.1 Programming Aids


Programmers use different kinds of tools or aids which help them
in developing programs faster and better. Such aids are studied
in the following paragraphs. Important aids available to a pro-
grammer are flowcharting and decision tables which help him in
constructing programs very fast and very easily.

1.1.1 Flowcharts
A flowchart is a graphical representation of the sequence of oper-
ations in an information system or program. Program flowcharts
show the sequence of instructions in a single program or
subroutine.
Flowchart uses boxes of different shapes to denote different
types of instructions. The actual instructions are written within
these boxes using clear and concise statements. These boxes are
connected by solid lines having arrow marks to indicate the flow
of operation, that is, the exact sequence in which the instructions
are to be executed. Since a flowchart shows the flow of operations
in pictorial form, any error in the logic of the procedure can be
detected easily. Once the flowchart is ready, the programmer can
forget about the logic and can concentrate only on coding the
operations in each box of the flowchart in terms of the statements
of the programming language. This will normally ensure an
error-free program.
A flowchart is basically the plan to be followed when the pro-
gram is written. It acts like a road map for a programmer and

-103-
guides him in proceeding from the starting point to the final
point while writing a computer program.
For a beginner it is strongly recommended that a flowchart
be drawn first in order to reduce the number of errors and omis-
sions in the program. Moreover, it is a good practice to have a
flowchart along with a computer program as it is very helpful
during the testing of the program and also in incorporating any
modifications in the program.

1.1.2 Flowchart Symbols


Only a few symbols are needed to indicate the necessary opera-
tions in a flowchart. These symbols have been standardized by
the American National Standards Institute (ANSI). These
symbols are shown in Figure 3.1 and their functions are dis-
cussed below.

Terminal
The terminal symbol, as the name implies, is used to indicate the
starting (BEGIN), stopping (END), and pause (HALT) in the pro-
gram logic flow. It is the first symbol and the last symbol in the
program logic. In addition, if the program logic calls for a pause
in the program, that also is indicated with a terminal symbol. A
pause is normally used in the program logic under some error
conditions or in case the forms had to be changed in the comput-
er’s line printer during the processing of that program.

Input/Output
The input/output symbol is used to denote any function of an
input/output device in the program. If there is a program
instruction to input data from a disk, tape, card reader, terminal,
or any other type of input device, that step will be indicated in
the flowchart with an input/output symbol. Similarly, all output
instructions, whether it is output on a printer, magnetic tape,
magnetic disk, terminal screen, or any output device, are indi-
cated in the flowchart with an input/output symbol.

Processing
A processing symbol is used in a flowchart to represent arithme-
tic and data movement instructions. Thus, all arithmetic

-104-
SYMBOL EXAMPLE

BEGIN START ACTION HERE.


TERMINAL
END STOP ACTION HERE.

INPUT TAKE TWO VALUES FROM


X,Y AN EXTERNAL SOURCE AND
ASSIGN THEM TO X & Y ON
INPUT/
A TERMINAL/SCREEN
OUTPUT

PRINT WRITE THE VALUES


X,Y CONTAINED IN X & Y ON
A TERMINAL/SCREEN

Z (X+Y) ADD THE VALUE CONTAINED


IN Y TO THE VALUE
PROCESSING
CONTAINED IN X AND
PLACE THE RESULT IN Z

1 AN ENTRY IN THE FLOW CHART


ENTRY CONNECTOR IS MADE AT THE CONNECTING
POINT MARKED 1

IF CONDITION IS SATISFIED
YES THEN YES PATH IS TO BE
CONDITION
FOLLOWED OTHERWISE NO
?
ROUTE IS TO BE TAKEN.
NO

DECISION DIAMOND
THE ARROWS INDICATE THE
ROUTES FOR SYSTEMATIC
FLOW LINES SOLUTION OF THE PROBLEM.

2 A TRANSFER OF PROBLEM
SOLUTION IS MADE AT THE
CONNECTOR
CONNECTOR POINT 2
(TRANSFER) IN THE FLOW CHART.

Figure 1.1 Flowchart symbols

-105-
processes such as adding, subtracting, multiplying and dividing
are shown by a processing symbol. The logical process of moving
data from one location of the main memory to another is also
denoted by this symbol. When more than one arithmetic and data
movement instructions are to be executed consecutively, they are
normally placed in the same processing box and they are
assumed to be executed in the order of their appearance.

Flow lines
Flowlines with arrowheads are used to indicate the flow of oper-
ation, that is, the exact sequence in which the instructions are to
be executed. The normal flow of flowchart is from top to bottom
and left to right. Arrowheads are required only when the normal
top to bottom flow is not to be followed. However, as a good prac-
tice and in order to avoid confusion, flow lines are usually drawn
with an arrowhead at the point of entry to a symbol. Good
practice also dictates that flow lines should not cross each other
and that such intersections should be avoided whenever possible.

Decision
The decision symbol is used in a flowchart to indicate a point at
which a decision has to be made and a branch to one of two or
more alternative points is possible. Figure 1.2 shows three differ-
ent ways in which a decision symbol can be used. It may be noted
from these examples that the criterion for making the decision
should be indicated clearly within the decision box. Moreover, the
condition upon which each of the possible exit paths will be
executed, should be identified and all the possible paths should
be accounted for. During execution, the appropriate path is fol-
lowed depending upon the result of the decision.

Connector
If a flowchart becomes very long, the flow lines start crisscrossing
at many places that causes confusion and reduces the clarity of
the flowchart. Moreover, there are instances when a flowchart
becomes too long to fit in a single page and the use of flow lines
becomes impossible. Thus, whenever a flowchart becomes too
complex that the number and direction of flow lines is confusing
or it spreads over more than one page, it is useful to utilize the

-106-
IS
No
I = 10
?

Yes

(a) Two-way branch

A<B COMPARE A>B


A&B

A=B

(b) Three-way branch

I=?

0 1 2 3 4 5 Other
(c) Multiple-way branch

Figure 1.2 Different decision symbols with different ways of branching

-107-
connector symbol as a substitute for flow lines. This symbol rep-
resents an entry from, or an exit to another part of the flowchart.
A connector symbol is represented by a circle and a letter or
digit is placed within the circle to indicate the link. A pair of
identically labeled connector symbols are commonly used to indi-
cate a continued flow when the use of a line is confusing. So two
connectors with identical labels serve the same function as a long
flow line. That is, they show an exit to some other chart section,
or they indicate an entry from another part of the chart. How is it
possible to determine if a connector is used as an entry or an exit
point? It is very simple: if an arrow enters but does not leave a
connector, it is an exit point and program control is transferred to
the identically labeled connector that does have an outlet. It may
be noted that connectors do not represent any operation and their
use in a flowchart is only for the sake of convenience and clarity.

Example 1.1
Draw a flowchart for adding marks in ten subjects obtained by a
student in an examination. The output should print the percent-
age of marks of the student in the examination.
The flowchart for this problem is given in Figure 1.3
The first symbol is a terminal labeled START. It shows that this
is the starting point or beginning of our flowchart logic. The sec-
ond symbol is an input/output (I/O) symbol that is labeled specif-
ically to show that this step is to read input data. This step will
input the roll number, name, and the marks obtained by the
student from an input device into the main storage of the com-
puter system. The third symbol is a processing symbol which is
suitably labeled to indicate that at this step, the computer will
add the marks obtained by the student in various subjects and
then store the sum in a memory location which has been given
the name TOTAL. The fourth symbol is again a processing sym-
bol. The label inside it clearly indicates that the percentage
marks obtained by a student is calculated at this stage by
dividing TOTAL by 10 and the result is stored in a memory loca-
tion which has been given the name PERCENTAGE. The fifth
symbol is an input/output (I/O) symbol and is labeled WRITE
OUTPUT DATA.

-108-
START

READ
INPUT
DATA

ADD-MARKS OF
ALL SUBJECTS
GIVING TOTAL

PERCENTAGE
= TOTAL/10

WRITE
OUTPUT
DATA

STOP

Figure 1.3 Flowchart for calculating percentage of marks

Example 1.2
Draw a flowchart for calculating the average percentage marks of
50 students. Each student appeared in ten subjects. The flow-
chart should show the counting of the number of student who
have appeared in the examination and the calculation should
stop when the number of counts reaches the number 50.
Since all the students have appeared in the same examina-
tion, so the process of calculation and printing the percentage
marks obtained by each student will basically remain the same.
The process of reading the input data, adding the marks of all

-109-
START

COUNT = 0

READ
INPUT
DATA

ADD-MARKS OF
ALL SUBJECTS
GIVING TOTAL

PERCENTAGE
= TOTAL/10

WRITE
OUTPUT
DATA

ADD 1 TO COUNT

IS
No
COUNT = 50
?

Yes

STOP

Figure 1.4 Flowchart for example 1.2

-110-
subjects, calculating the percentage, and then writing the output
data, is to be repeated for all the 50 students. In this situation
where the same logical steps can be repeated, the flow line sym-
bols are used in a flowchart to indicate the repetitive nature of
the logic in the form of a loop.
Figure 1.4 shows a flowchart which uses a decision step to
terminate the algorithm. In this flowchart, another variable
COUNT has been introduced which is initialized to zero outside
the process loop and is incremented by 1 after processing the data
for each student. Thus, the value of COUNT will always be equal
to the number of students whose data has already been pro-
cessed. At the decision step, the value of COUNT is compared
with 50 which is the total number of students who have appeared
for the examination. The steps within the process loop are
repeated until the value of COUNT becomes equal to 50. As soon
as the value of COUNT becomes equal to 50, the instruction at
the decision step causes the control to flow out of the loop and the
processing stops because a terminal symbol labeled STOP is
encountered.

Designing a General Flowchart


The flowchart shown in Figure 1.4 is not a general flowchart for
the Example 1.2 for calculating the percentage of marks of any
number of students appearing in the examination. A good pro-
gram should be general in nature. For example, in this case we
should write a program that need not be modified every time,
even if the total number of students changes.
To overcome these drawbacks, another method can be
adopted to control the loop. In this method, the end of input data
is marked by a trailer record, that is, the last data record in the
input is followed by a record whose main purpose is to indicate
that the end of the input data has been reached. Suppose the first
7 characters of the input record of a student represents his roll
number (ROLLNO). Since 0000000 is never used as a roll num-
ber, a value of 0000000 as the first 7 characters can be used to
represent the trailer record. As each input record is processed,
the ROLLNO can be compared with 0000000 to determine if pro-
cessing is complete. The logic of this process is illustrated in the
flowchart given in Figure 1.5.

-111-
START

READ
INPUT
DATA

IS Yes
ROLL NO=0000000
?
No

ADD-MARKS OF STOP
ALL SUBJECTS
GIVING TOTAL

PERCENTAGE
= TOTAL/10

WRITE
OUTPUT
DATA

Figure 1.5 General flowchart for example 1.2

What is Trailer Record?


The concept of a trailer record centers around the notion of
selecting a field (a particular item of data) in the input record
which will be used to indicate the end of data, and then selecting
a trailer value also known as sentinel value which will never
occur as normal data value for that field. The roll number
0000000 is a trailer record for Example 1.2.

-112-
Example 1.3
Extend the flowchart represented in Figure 1.5 to count the
number of students who have scored percentage marks more
than 30. The flowchart should give the result of the students
scoring the percentage marks equal to or more than 30.

START

COUNT = 0

READ
INPUT
DATA

IS
Yes
ROLL NO.9999999
?

No

ADD-MARKS OF
ALL SUBJECTS
WRITE
GIVING TOTAL
COUNT

PERCENTAGE
STOP
= TOTAL/10

IS
PERCENTAGE No
= > 30
?
Yes

WRITE
OUTPUT
DATA

ADD 1 TO COUNT

Figure 1.6 Flowchart for example 1.3

-113-
The flowchart in Figure 1.6 is a solution to this problem.
There are two decision symbols in this flowchart. The first deci-
sion symbol checks for a trailer record by comparing ROLLNO
against the value 9999999 to determine if processing is complete.
The second decision symbol is used to check whether the student
has passed or failed by comparing the percentage marks obtained
by him against 30. If the student’s PERCENTAGE is equal to or
more than 30, then he has passed, otherwise he has failed. Note
from the flowchart that the operation WRITE OUTPUT DATA is
performed only if the student has passed. If he has failed, we
directly perform the operation READ INPUT DATA without per-
forming the WRITE operation. This ensures that the output list
provided by the computer will contain the details of only those
students who have passed in the examination.
Another point to be noted in this flowchart is the use of vari-
able COUNT. This variable has been initialized to zero in the
beginning and is increased by 1 every time the operation WRITE
OUTPUT DATA is performed. But we have seen that the opera-
tion WRITE OUTPUT DATA is performed only for the students
who have passed. Hence, the variable COUNT will be increased
by 1 only in the case of those students who have passed. Thus,
the value of COUNT will always be equal to the number of stu-
dents whose data has already been processed and who have been
identified as passed. Finally, when the trailer record is detected,
the operation WRITE COUNT will print out the final value of
COUNT that will be equal to the total number of students who
have passed the examination.

1.1.3 Flowcharting Rules


(a) First formulate the main line of logic, then incorporate the
details.
(b) Maintain a consistent level of detail for a given flowchart.
(c) Do not give every detail on the flowchart. A reader who is
interested in greater details can refer to the program itself.
(d) Words in the flowchart symbols should be common state-
ments and easy to understand.
(e) Be consistent in using names and variables in the flowchart.
(f) Go from left to right and top to bottom in constructing the
flowchart.

-114-
(g) Keep the flowchart as simple as possible. The crossing of
flow lines should be avoided as far as possible.
(h) If a new flowcharting page is needed, it is recommended
that the flowchart be broken at an input or output point.
Moreover, properly labeled connectors should be used to link
the portions of the flowchart on different pages.

1.1.4 Advantages of Flowcharts

Conveys Better Meaning


Since a flowchart is a pictorial representation of a program, it is
easier for a programmer to understand and explain the logic of
the program to some other programmer.

Analyses the Problem Effectively


A macro flowchart that charts the main line of logic of a software
system becomes a system model that can be broken down into
detailed parts for study and further analysis of the system.

Effective Joining of a Part of a System


A group of programmers are normally associated with the design
of large software systems. Each programmer is responsible for
designing only a part of the entire system. So initially, if each
programmer draws a flowchart for his part of design, the flow-
charts of all the programmers can be placed together to visualize
the overall system design. Any problem in linking the various
parts of the system can be easily detected at this stage and the
design can be accordingly modified. Flowcharts can thus be used
as working models in the design of new programs and software
systems.

Efficient Coding
Once a flowchart is ready, programmers find it very easy to write
the concerned program because the flowchart acts as a roadmap
for them. It guides them in proceeding from the starting point of
the program to the final point ensuring that no steps are omitted.
The ultimate result is an error free program developed at a
faster rate.

-115-
Systematic Debugging
Even after taking full care in program design, some errors may
remain in the program because the designer might have never
thought about a particular case. These errors are detected only
when we start executing the program on a computer. Such type of
program errors are called bugs and the process of removing these
errors is known as debugging. A flowchart is very helpful in
detecting, locating, and removing mistakes (bugs) in a program
in a systematic manner.

Systematic Testing
Testing is the process of confirming whether a program will suc-
cessfully do all the jobs for which it has been designed under the
specified constraints. For testing a program, different sets of data
are fed as input to that program to test the different paths in the
program logic.

1.1.5 Limitations of Flowcharts

Takes More Time to Draw


Flowcharts are very time consuming and laborious to draw with
proper symbols and spacing, especially for large complex pro-
grams.

Difficult to Make Changes


Owing to the symbol-string nature of flowcharting, any changes
or modifications in the program logic will usually require a com-
pletely new flowchart. Redrawing a flowchart is tedious and
many companies either do not change them or produce the
flowchart by using a computer program to draw it.

Non-standardization
There are no standards determining the amount of detail that
should be included in a flowchart.

1.1.6 Levels of Flowcharts


A flowchart that outlines the main segments of a program and
shows lesser detail is a macro-flowchart. On the other hand, a

-116-
PART OF A MACRO
FLOW CHART

A MICRO
FLOW CHART

I=1
TOTAL = 0

TOTAL = TOTAL + MARKS (I)


ADD-MARKS OF
ALL SUBJECTS
GIVING TOTAL I=I+1

IS
NO I > 10
?
YES

Figure 1.7 Details of the processing block of Figure 1.3 for adding marks in 10
subjects

flowchart with more detail is a micro-flowchart. For example, let


us consider the examination problem that we have already dis-
cussed in Examples 1.3 and 1.4. In all the flowcharts of the
examination problem, there is a processing box having the
instruction "ADD MARKS OF ALL SUBJECTS GIVING
TOTAL". In order to display how the values of TOTAL is calcu-
lated, a detailed flowchart can be drawn as shown in Figure 1.7.
In a similar manner, the input/output (I/O) boxes for the READ
and WRITE operations can also be converted to a detailed flow-
chart.

-117-
1.3.1 Problem Definition
Let us take an example of a problem faced in day- to- day life.
Suppose you want to reach your school computer laboratory at 8
AM. You would lay out a plan to get ready by 7 AM, then take a
bus/rikshaw and reach at the gate of your school. Then climb up
the stairs to arrive in the laboratory. For all these movements,
you will note the time taken for each part. If due to some reason,
you are unable to get ready by 7 AM and you already know that
it takes one hour to reach from house to school laboratory by
bus/rikshaw, then you will take a faster means of transportation.
You may take an autorikshaw or a taxi. Thus, a very simple
problem of reaching the computer laboratory of your school by 8
AM will need several steps for solution. Each step is to be accu-
rately defined/marked so that no guess work is necessary. You
can thus represent the solution of this problem in three steps
shown in Figure 1.11.
In Figure 1.13, steps 1, 2 and 3 appear to be very simple. In
actual practice when you have to give instructions to a student,
who is going for the first time, it may not be so easy. For example,
you have to define the word "READY" precisely so that he knows
exactly what he has to do by 7AM to get READY. Similarly in
step 2, you may have to clearly specify the bus route number, the
bus stop to board the bus, the place to get down from the bus etc.
You may also like to tell that a bus is not to be boarded, if it is
overcrowded. The word "overcrowded" needs to be exactly
defined. Finally, step 3 needs further elaboration about the room
number and floor number; where the computer laboratory is
located and how to reach there.
You can explain all this to a person who does not know any
thing about the computer laboratory, provided you know it cor-
rectly. In the same way, you can solve a problem on a computer,
if you know exactly what it is and how to solve it manually.
We shall solve a few problems using flowchart.

-118-
GET READY
STEP 1
BY 7 AM

TAKE A BUS STEP 2


FOR SCHOOL

REACH
COMPUTER STEP 3
LAB BY 8 AM

Figure 1.13 Step by step solution to reach school computer laboratory (LAB)

Example 1.7
Consider the flowchart shown in Figure 1.14. Give the value of
BONUS under the following conditions:
(a) X = 20, Y = 10
(b) X = 10, Y = 20

Solution
(a) The value of X and Y are 20 and 10 respectively. These val-
ues are inputted in step 2. The value of BONUS is taken as
500 in step 1. Since the values of X = 20 and Y = 10, so in
step 4, X is more than Y.

-119-
Therefore the Yes route is to be followed. Hence the new
value of BONUS is the old value of BONUS + 100 i.e. 600.
Hence the value of BONUS written in step 5 is 600.
(b) Here, the value of X=10 & Y=20. Therefore in step 4, the
diamond decision shows that X is less than Y. Therefore,
the No route is followed. The value of BONUS remains 500
only. Hence the result is 500.

STEP 1 BEGIN

INPUT
STEP 2
X,Y

STEP 3 BONUS = 500

IS YES
STEP 4 X > Y BONUS BONUS + 100
?
NO

STEP 5 PRINT
BONUS

STEP 6 END

Figure 1.14 Bonus calculation

Example 1.8
Here are six types of values for the variables A, B, and C.
(a) A=9, B=5, C=1 (b) A=7, B=3, C=9
(c) A=2, B=9, C=7 (d) A=4, B=8, C=2
(e) A=6, B=3, C=8 (f) A=2, B=3, C=6
1. Using each type of data, with the flowchart shown in Figure
1.15, state the output in each case.

-120-
2. What does the procedure do?
1. What happens, if all the values of A, B and C are the same?

Solution
1.(a) The values of A, B and C are accepted as 9, 5 and 1 respec-
tively. In step 3, the value of A is compared with B. Since 9
is greater than 5, therefore the YES path is followed. Once
again, in step 4, the value of A is compared with C. Here 9
is greater than 1. So the YES path is followed. In step 5,
value of ‘A’ is printed which is 9. Hence the answer is 9.
(b) The values of A, B and C are accepted as 7, 3 and 9 respec-
tively. In step 3 the value of A is compared with B. Since 7
is greater than 3, therefore, the YES path is followed. In
step 4, the value of A is compared with C. Since 7 is less
than 9, therefore the path corresponding to NO is followed.
Hence the value of C which is 9 will be printed.
(c) The values of A, B and C are accepted as 2, 9, and 7 respec-
tively. As understood from steps (a) and (b) above, we find
that in step 5 the value of B will be printed as 9.
(d) The values of A, B and C are accepted as 4, 8 and 2 respec-
tively. In step 5, the value of B will be printed as 8.
(e) The values of A, B and C are accepted as 6, 3 and 8 respec-
tively. The value of C which is 8 will be printed in step 5.
(f) The values of A, B and C are accepted as 2, 3 and 6 respec-
tively. The value of C which is 6 is printed in step 5.
2. It is evident from the flowchart that the values of A, B and
C are compared with each other and the one that contains
the highest numeral value is printed. If A has the highest
value, then A is printed, otherwise, if B has the highest
value, then B is printed or finally the value of C is printed if
it has the highest value.
1. If A, B and C have equal values, then the value of C which
is the same as that of B or A is printed.

-121-
BEGIN STEP 1

INPUT STEP 2
A,B,C

NO IS YES
A>B STEP 3
?

NO IS YES NO IS YES
B>C A>C STEP 4
? ?

PRINT C PRINT B PRINT C PRINT A STEP 5

END END END END STEP 6

Figure 1.15 Calculation of output for different values of A, B and C

Example 1.9
The flowchart in Figure 1.16 uses connector symbols labelled as
1, 2 and 3. Find the output if the input is:
(a) A=10, B=15,
(b) A=20, B=20,
(c) A=4, B=1,
(d) A=10, B=5.

-122-
Solution
(a) In step 2 of Figure 1.16, the values of A and B are taken to
be 10 and 15 respectively. In step 3, the value of A is not
less than 10, so the path corresponding to NO is followed.
In step 4, the value of B is not less than 20, hence a
path corresponding to NO is followed. In step 5, the value of
(A+B) is assigned to C, i.e. C becomes (10+15) or equal to
25. Finally, in step 6, the value of C which is 25 is printed.
(b) In step 2, the values of A and B are taken as 20 and 20
respectively. Steps 3 to 5 are similar to that followed in part
(a) above. The value of C is now equal to (A+B) which is 40.
Hence 40 is printed.
(c) In step 2, the values of A and B are taken as 4 and 1
respectively. In step 3, the value of A is less than 10. Hence
the YES path is followed. This is connected to the adjacent
figure via the connector 1. Hence the value of A is now the
old value of A + 3, i.e. 7.
Further, the decision diamond puts the question "Is A less
than 10?" The answer is YES. Hence the control is trans-
ferred to the lower figure via connector 2. The new value
of B becomes the old value of B multiplied by 5 which is 1 x
3 = 1. The diamond compares the value of B with 20. Since
B is less than 20, so the control is transferred back at 2 in
this block. The new value of B becomes the old value of B
multiplied by 3.
=3×3
=9

This new value of B i.e. 9 is again compared in the decision


diamond. Since 9 is less than 20, the control goes to con-
necter 2. B is again multiplied and the current value of B is
3 × 9 = 27. As 27 is not less than 20, so the NO path is
followed.
The value of C = current value of B + 3
= 27 + 3
= 30
The value 30 of C is now transferred to step 6 i.e. PRINT C.
Hence the value 30 is printed.

-123-
STEP 1 BEGIN
1 A (A+3)

INPUT
STEP 2
A,B
IS Yes
A < 10 2
?
IS Yes No
STEP 3 A < 10 1
?
C=3*A 3
No

IS
STEP 4 B < 20 2
?
No
2 B B*3
STEP 5 C (A + B)

IS Yes
B < 20 2
STEP 6 PRINT C 3 ?
No

C (B + 3) 3
STEP 7 END

Figure 1.16 Flowchart for example 1.9

(d) Here A=10 and B=5


In step 3, the value of A is not less than 10, so the NO path
is followed.

-124-
In step 4, the value of B is 5 which is less than 20.
Hence connector 2 takes the control to right hand lower
side flowchart. The current value of B becomes the old
value of B multiplied by 3 which is now 15. This value of B
i.e. 15 is the current value of B. In the decision diamond,
this value of B is compared with 20. Since 15 is less than
20, so the YES path is followed. The control is transferred
back via connector 2. The new value of B is calculated
which will be 15 × 3 i.e. 45. This current value of B is again
compared with 20. As it is not less than 20, so the NO path
is followed.

The value of C = current value of B + 3


= 45 + 3
= 48

Control is transferred to step 6 via connector 3 and the value of C


is printed. Thus the value of C = 48.

1.3.2 Loop
Many jobs that are required to be done with the help of a com-
puter are repetitive in nature. For example, calculation of salary
of different workers in a factory is given by the (No. of hours
worked)× (wage rate). This calculation will be performed by an
accountant for each worker every month. Such types of repetitive
calculations can easily be done using a program that has a loop
built into the solution of the problem .

What is a Loop ?
A loop is defined as a block of processing steps repeated a certain
number of times. An endless loop repeats infinitely and is always
the result of an error.
Figure 1.17 illustrates a flowchart showing the concept of
looping. It shows a flowchart for printing values 1, 2, 3..., 20.
In step 5 of Figure 1.17, the current value of A is compared
with 21. If the current value of A is less than 21, steps 3 and 4 are
repeated. As soon as the current value of A is not less than 21,
the path corresponding to "NO" is followed and the repetition
process stops.

-125-
Terms Used in Looping:
Initialisation

BEGIN STEP 1

A=1 STEP 2

PRINT A STEP 3

A (A + 1) STEP 4

STEP 5
IS NO
A < 21 END
?
YES

Figure 1.17 Concept of looping

It is the preparation required before entering a loop. In Figure


1.17, step 2 initialises the value of A as 1.
Incrementation It is the numerical value added to the variable
each time one goes round the loop. Step 4 in Figure 1.17 shows
the increment of A by 1.

-126-
BEGIN STEP 1

COUNT = 1 STEP 2

IS
YES
COUNT > 100 END STEP 3
?

NO

INPUT
NAME, WAGE, STEP 4
HOURS

PAY WAGE x HOURS STEP 5

PRINT
NAME, PAY STEP 6

COUNT COUNT + 1 STEP 7

Figure 1.18 Flowchart for calculating the salary of 100 workers

-127-
The Loop Variable It is an active variable in a loop. In Figure 1.17,
A is an active variable.
Loop Exit Test There must be some method of leaving the loop
after it has revolved the requisite number of times. In Figure
1.17, step 5 is the decision diamond, where the value of A is com-
pared with 21. As soon as the condition is satisfied, control comes
out of the loop and the process stops.

Example 1.10
Draw a flowchart for calculating the salary of 100 workers in a
factory.

Solution
Figure 1.18 represents the flowchart. In Figure 1.18, step 2 is for
initialisation of the value of COUNT where COUNT is an active
variable. Step 7 is the incrementation. Step 3 is for the EXIT test.
Steps 4 to 6 are the repetitive steps in the loop to input the
NAME, WAGE and HOURS, and then calculate the value of PAY
in step 5 and print the name and pay in step 6.
In step 7, the value of COUNT is increased by 1 and the cur-
rent value of COUNT is compared with 100 in step 1. If it is more
than 100, the process is halted.

Exercise 1.1

Q 1. How many records will be read by the flowcharts, shown in


Figures 1.19 and 1.20.
Q 2. A certain file contains 15 records. Which of the flowcharts
shown in Figures 1.21 and 1.22 read 15 and only 15
records?
Q 3. The formula to compute simple interest I on a loan of
rupees P at an interest rate R for T years is given as
PRT
I=
100

Draw a flowchart to input the values of P, R and T and to


calculate the value of interest I. Also print the values of P,
R, T and I.
-128-
Q 4. The flowchart shown in Figure 1.23 is drawn to print the
sum of integers 1 to 100. What changes would you make in
this flowchart, if the SUM for the first 100 odd integers is
required? Redraw the flowchart.

BEGIN

I=0

I I+1

READ K

IS
YES I < 10
?

NO

END

Figure 1.19 Reading of records

-129-
BEGIN

I=0

I I+1

IS YES
I < 10
?

NO

READ K

END

Figure 1.20 Reading of records

Q 5. Consider an equation Y=X2+2X+3. Draw a flowchart which


gives a method for calculating the values of Y for different
values of X varying from -4 to +4 in steps of 1 and prints
each value of X and the corresponding value of Y.

-130-
BEGIN

I=0

IS YES
I = 15
?

NO

READ
RECORD

I I+1

END

Figure 1.21 Counting of records

-131-
BEGIN

I=0

I I+1

IS YES
I > 15
?

NO
READ
RECORD

END

Figure 1.22 Counting of records

1.3.3 Counting
Counting is an essential technique used in the problem solving
process. It is mainly for repeating a procedure for a certain num-
ber of times or to count the occurrences of specific events or to
generate a sequence of numbers for computational use. Since a

-132-
BEGIN

A=1
SUM = 0

SUM SUM + A

A A+1

YES IS
A < 101
?

NO

PRINT SUM

END

Figure 1.23 Calculating sum of integers 1 to 100

computer cannot count by itself, the user has to send the neces-
sary instruction to do so. The counting process is illustrated in
the flowchart shown in Figure 1.24
Here I is a counter which is initialised to a value zero in step
2. In step 3, a NAME is read and stored in the memory of the

-133-
BEGIN STEP 1

I=0 STEP 2

READ NAME STEP 3

I (I + 1) STEP 4

PRINT NAME STEP 5

YES IS
I<5 STEP 6
?

NO

END STEP 7

Figure 1.24 Counting process

computer. The value of the counter is incremented by 1 in step 4.


In step 5, the NAME is printed from the memory of the computer.
In step 6, a check is made on the value of I. If the current value of
I is less than 5, the cycle is repeated from steps 3 to 5. If the value
of I is equal to or more than 5, the process of reading and printing
NAME stops. Using this type of flowchart we can read and print
the NAME five times.

-134-
Example 1.11
Which numbers will be printed by the flowcharts shown in Fig-
ures 1.25 and 1.26 respectively?

BEGIN STEP 1

I=0 STEP 2

I I+1 STEP 3

PRINT I STEP 4

NO IS
I >5 STEP 5
?

YES
END STEP 6

Figure 1.25 Flowchart for printing numbers

Solution
(a) In Figure 1.25, the value of I is initialised to zero in step 2.
In step 3, the value is incremented by 1, i.e. it is 1. In step 4

-135-
BEGIN STEP 1

I=1 STEP 2

PRINT I STEP 3

I I+1 STEP 4

YES IS
I <5 STEP 5
?

NO
END STEP 6

Figure 1.26 Flowchart for printing numbers

I is printed. In step 5, the current value of I is compared


with 5. Since the current value of I is 1 and 1 is not greater
than or equal to 5, the control is transferred to step 3. Steps
3 and 4 are repeated again till the current value of I is 5.
Thus, the values of I that are printed would be 1, 2, 3, 4, 5.
(b) In Figure 1.26, the value of I is initialised to 1 in step 2. The
number 1 is printed in step 3. In step 4, the value of I is
increased by 1. So the current value of I is 2. In step 5, 2 is
compared with 5. Since 2 is less than 5, so the control is

-136-
transferred to step 3 and the number 2 is printed. This
cycle repeats and numbers 3 and 4 are printed. When the
current value of I reaches 5, the control is transferred from
step 5 to 6. Thus the numbers printed are 1, 2, 3 and 4.

Exercise 1.2

Q 1. Which numbers will be printed using the flowcharts shown


in Figures 1.27 and 1.28 respectively.

BEGIN

I=0

I I+1

PRINT I

YES IS
I <5
?

NO
END

Figure 1.27 Printing of numbers

-137-
Q 2. Write a flowchart to print the following sequence of num-
bers.
(a) 20, 19, 18, 17,...., 1.
(b) 2, 4, 6, 8,....., 32.
Q.3 In the flowchart shown in Fig 1.29, the following data is
inputted.

BEGIN

I=0

IS YES
I >5
?

NO

I I+1

PRINT I

END

Figure 1.28 Printing of numbers

-138-
BEGIN

INPUT
SALES MAN’S
NAME

INPUT
VALUE OF GOODS
SOLD

IS
YES WAGE 50 +
VALUE < 500
10 % OF VALUE
?

NO

IS YES WAGE 80 +
VALUE > 500
10 % OF VALUE
?

NO

PRIINT:
SALES MAN’S NAME,
VALUE OF GOODS
SOLD,
WAGE.

END

Figure 1.29 Flowchart for Q. 3 in Exercise 1.2

-139-
Input Data
Salesman’s Name Value of goods sold
(a) Mohan 1500
(b) Shyam 2100
(c) Krishna 510
Calculate the value of wage in each case and give the result
of the print statement.

1.3.4 Counting for Controlling a Loop


Sometimes, it is essential to repeat a process for a specific num-
ber of times only. In such a case, there are two standard tech-
niques used. These technique are as follows:

Technique 1
In this technique, we use the following six steps.
1. Initialise a counter to 0, i.e. COUNT = 0. Input value of N
where N stands for the number of times a loop is to be
repeated.
2. Increase the counter by 1. or COUNT = COUNT + 1
3. Test the value of counter and compare the current value
with N. If the current value of the COUNT is greater than
N, then branch off to step 6, otherwise continue.
4. Carryout the sets of instructions (procedure).
5. Go back to step 2.
6. End the loop and continue further programming. These six
steps are shown in Fig 1.30.

Technique 2

1. In this method, the counter is first initialised to zero and


the value of N is inputted.
2. Carry out the sets of instructions of the program.
3. Increase the counter by 1.
4. Test the counter. If COUNT < N then Go to step 2.
5. ELSE END
The above mentioned six steps are represented pictorially by the
flowchart shown in Figure 1.31.

-140-
BEGIN

STEP 1
COUNT = 0

INPUT N STEP 2

COUNT COUNT + 1

IS YES
COUNT > N STEP 3
?
NO
SET OF STEP 4
INSTRUCTIONS STEP 5

END STEP 6

Figure 1.30 Flowchart for controlling a loop (Technique 1)

Sometimes, it may be necessary to repeatedly use any of the


above two techniques in order to solve a specific problem. This is
called nested loop. It means that we have the first loop and
within this loop, there is another loop. Solving a problem using
the nested loop technique is very helpful for a multidimensional
array.

-141-
BEGIN

COUNT = 0

STEP 1

INPUT N

SET OF
STEP 2
INSTRUCTIONS

COUNT COUNT + 1 STEP 3

YES IS
COUNT < N STEPS 4 & 5
?

NO STEP 6
END

Figure 1.31 Flowchart for controlling a loop (Technique 2)

1.4 Procedure for Problem Solving

Though every problem is an entity in itself, there are a few basic


steps that should be understood and followed for effectively solv-
ing a problem using computer techniques. On following these
steps, your problem solving capacity will improve. There are
basically six steps in solving a problem. These are:

-142-
1. First, spend sometime in understanding the problem thor-
oughly. In this, you are not required to use a computer.
Instead try to answer and solve the problem manually.
2. Now construct a list of variables that are needed to solve
the problem.
3. Once you have completed step 2, you have to decide the
layout for the output format.
4. Next, select the programming technique which is best
suited to solve the problem and carryout the coding.
5. Test your program. Choose some test data so that each part
of the program is checked for correctness.
6. Finally use the data validation program to guard against
processing of wrong data.
The above six steps are further explained in the following para-
graphs.

1.4.1 Step 1. Understanding the Problem


Read each statement in the problem carefully, so that you can
answer the first question "What is expected by solving the prob-
lem?" Do not start drawing a flowchart straight away. Instead,
read each statement of the problem slowly and carefully,
understanding the keywords. Take a pencil and paper and try to
solve the problem manually for some test data. Let us under-
stand this point by solving the problem, given in Example 1.12.

Example 1.12
Write a flowchart to accept a value M and find the sum of first M
even integers.

Solution
The solution of this problem requires you to draw a flowchart so
that if you input 6 as the value of M, the flowchart should get you
the sum of first 6 even integers. In the first step, you should be
able to answer the following two questions.
"What are the first 6 even integers?"
These are 2, 4, 6, 8, 10, and 12.
"What is their sum?"
-143-
The sum is 42. Hence the flowchart is to be so framed that the
sum of first 6 even integers comes out to be 42.

1.4.2 Step 2. Construction of the List of Variables


In this step, you should think in advance the number of variables
and the names of the variables before drawing a flowchart. The
names chosen for variables should be an aid to memory. For
example, in the case of the problem stated in step 1 above, the
variables may be, I, SUM and COUNT as given below.
1. Generate even integers 2, 4, 6,...(I)
2. Total the sum of even integers 2+4+6+... (SUM)
3. Count the number of even integers, i.e. COUNT 1, 2, 3,...
(COUNT)
Thus, it is clear that we need to use the above three variables
and one more variable "M" whose value will be inputted from the
keyboard. Hence the four variables are:
M Which is to be inputted from the keyboard.
I Which is to generate even integers.
COUNT A counter to keep a track of the number of even inte-
gers that have been summed.
SUM An accumulator that contains the current total of the
even integers.

1.4.3 Step 3. Output Design


Sometimes, the ‘output’ format is specified in the problem, but
most of the times, it is not so. If the output format is not specified,
we must keep in mind that the output report should be easily
understandable by a reader. The headings should not cause any
ambiguity in the mind of the reader.
In the problem of Example 1.12 and stated in step 1 above,
the output format could be as follows:
No of integers Total value

6 42
You should keep one point in mind. The programs and prob-
lem solutions are for other people (teachers, supervisors, contrac-

-144-
tors etc). They will give you credit only if they can understand the
results and analyse them. Hence, the output format should be
attractive, easy to read and self-explanatory.

1.4.4 Step 4. Program Development


You should now draw a flowchart for the procedure that you have
developed in steps 1 to 3 above. Standard symbols should be used
for drawing a flowchart. If a problem is complex, you should
divide it into different parts. Then draw a flowchart for each part
separately and join them together using connectors.
A flowchart for the problem in Example 1.12 and stated in
step 1 can be drawn as shown in Figure 1.32.
When a flowchart is drawn correctly, you can convert it into a
programme using any of the high level languages like BASIC,
COBOL, FORTRAN or PASCAL.

1.4.5 Step 5. Testing the Program


You should give a dry run to a program that translates the flow-
chart of step 4. This means giving some known values to the
variables and checking the result. Test values are so selected that
each arm of the flowchart is tested and consequently the program
is confirmed to be free from logic errors.

1.4.6 Step 6. Validating the Program


It is quite likely that the user of your program may enter values,
which are not expected by the program. Such values should be
rejected by the procedure drawn by you. This is known as valida-
tion of data program. For example, in the problem in Example
1.12 and stated in step 1 above, we may give the limit to the
value of "M" and "M" should be a numerical value. Such types of
checks can be included in our validation program.

1.5 Algorithm
The sequence of instructions for solving a particular problem is
known as algorithm. Constructing an algorithm to solve a given
problem requires a high degree of ingenuity. But once an

-145-
algorithm is laid out, it can be used by a person who does not
even know its purpose.

BEGIN

INPUT M

I = 0

SUM = 0

COUNT = 0

SUM = SUM + I

COUNT
= COUNT + 1 I = I + 2

NO IS
COUNT > M

YES
PRINT
SUM, COUNT

END

Figure 1.32 Flowchart to Example 1.13

-146-
We shall write an algorithm to solve a quadratic equation
and compute its real roots.

Example 1.13
Compute real roots of a quadratic equation

Ax 2 + Bx + C = 0

Solution

Step 1
Read the values of the coefficients of X2, X and constant quantity,
i.e., the value of A, B and C and store them in the memory.

Step 2
If A = 0 and B = 0 then print "No root exists" and stop. Else con-
tinue.

Step 3
If A = 0 and B is not equal to 0, then root X1 = C/B. Write the
value of root and also write "Linear Equation" and stop. Else
continue.

Step 4
Compute (B2 4AC) and set D2 = B2 4AC

Step 5
If D = 0, then compute Root X1 = Root X2 =( B/2A), write values
of Root X1, Root X2 and stop. Else continue.

Step 6
If D < 0, then write "Roots are not real" and stop. Else continue.

Step 7
If D > 0, then calculate
Root X1 = ( B + (B2 4AC)/(2A))
Root X2 = ( B (B2 4AC)/(2A))

-147-
1.5.1 Characteristics of the Instructions in an Algorithm
Write values of Root X1, Root X2 and stop.
The sequence of instructions must possess the following
characteristics for qualifying as an algorithm :
1. Each and every instruction should be precise and unambig-
uous.
2. Each instruction should be such that it can be performed in
a finite time.
3. One or more instructions should not be repeated indefi-
nitely. This ensures that the algorithm will ultimately ter-
minate.
4. After performing the instructions, that is, after the algo-
rithm terminates, the desired results must be obtained.

Example 1.14
Let us consider another case where there are 50 students in a
class who have appeared in their final examination. Their mark-
sheets have been given. We are required to write an algorithm to
calculate and print the total number of students who have passed
in first division.

Solution

Step 1
Initialize TOTAL, FIRST_DIVISION and TOTAL MARK-
SHEETS_CHECKED to zero.

Step 2
Take the marksheet of the first student.

Step 3
Check the division column of the marksheet to see if it is
FIRST_DIVISION : if no, go to step 5.

Step 4
Add 1 to TOTAL FIRST_DIVISION.

-148-
Step 5
Add 1 to TOTAL MARKSHEETS_CHECKED.

Step 6
Is TOTAL MARKSHEETS_CHECKED = 50? : if no, go to step 2.

Step 7:
Print TOTAL FIRST_DIVISION.

Step 8:
Stop.

1.6 Programming
If we compare structured programming to building a house, then
structured programming is to build the house after the plan for
the house is drawn. We would like to build a house using stan-
dard bricks, window-frames, doors etc., so that the house so con-
structed is appealing and comfortable. Thus, structured
programming also contains three standard control structure.
These are:

Simple Sequence Simple Selection Simple Repetition

The above three structures are simple to use as they can be


recognised easily. They have one entry and one exit point and
they are free from any programming language used for coding a
solution of a problem. This is discussed in detail in section 1.8.

1.6.1 Modular (Top-Down) Program Design


You must have realised that an effective approach to follow in the
programming analysis stage of program development is to break
down a large problem into a series of smaller and more under-
standable tasks. Thus, the programmer may first develop a
main-control program that is used to outline the major segments,
or modules, that are in turn needed to solve a problem. The
main-control program specifies the order in which each subordi-
nate module in the program will be processed. The programming

-149-
‫متارين عامــة‬
‫‪ ‬عرف انهُذسة يع ركر االَشغة انًختهفة انتً تتعهك تها؟‬
‫‪ ‬يا هً فروع انهُذسة انرئيسية؟‬
‫‪ ‬أركر تعضا يٍ يجاالت انهُذسة انتخصصية انثاَىية؟‬
‫‪ ‬أركرانفرق تيٍ انهُذسة وتكُىنىجيا انهُذسة يع تىضيح رنك‬
‫تاأليثهة ؟‬
‫‪ ‬يا هً أهًيه انعًم نالَساٌ؟ وانحجات األساسية نإلَساٌ؟‬
‫‪ ‬أركر انتعريف انًحذد نكال يٍ انىظيفه وانعًم وانًهُه؟‬
‫‪ ‬أركر يثاال يىضح انًمىيات االساسية نههُذسة ؟‬
‫‪ ‬يا هً انصفات انتً يجة اٌ يتحهً تها انًهُذش؟‬
‫‪ ‬أركر أوجه انُشاط انهُذسً يع تفصيم ثالث جىاَة؟‬
‫‪ ‬يا هً انسًات انتً تًيس انًهُذش انُاجح؟‬
‫‪ ‬أركرتانتفصيم ألساو انفريك انهُذسً ؟وانُسة انًختهفه نكم‬
‫لسى؟‬
‫‪ ‬اركر تإختصار تاريخ انتعهيى انهُذسً فً يصر؟‬
‫‪ ‬أركر تخصصات انهُذسه ؟ويذي ارتثاط جىاَة انعهىو تيُهى؟‬
‫‪ ‬اركرتانتفصيم انًجاالت انتً تىضح يذي ارتثاط انهُذسة‬
‫انًذَية تانًجتًع؟‬
‫‪ ‬أركر انخغىات انالزية إلتًاو أي يشروع هُذسً؟‬

‫‪-150-‬‬
‫‪ ‬عرف كال يٍ تراسم انثياَات ‪ ،‬إتصاالت انحاسة ‪،‬‬
‫انشثكات‪،‬انىحذات‪ ،‬انتراتظ تيٍ انشثكات؟‬
‫‪ ‬أركر تانتفصيم األَىاع انرئيسية نهشثكات؟‬
‫‪ ‬أركر تانتفصيم انًكىَات انًادية نشثكة انحاسة يىضحا رنك‬
‫تانشكم؟‬
‫‪ ‬ياهً شثكة انحاسة؟ ويا هً انمىاعذ االساسية نضًاٌ أياَة‬
‫َمم انًعهىيات عثر شثكة انحاسة؟ انغرض يٍ تُاء شثكات‬
‫انحاسة؟‬
‫‪ ‬وضح يعاييرتُاء شثكة انحاسة؟ يع انتىضيح تاالشكال تفاصيم‬
‫كم يعيار؟‬
‫‪ ‬أركر أَىاع شثكة انحاسة عثما نغثىغرافية أو شكم انشثكه‬
‫يىضحا رنك تانرسى ؟ يع ركرأهى انًًيسات وانعيىب نكم َىع؟‬
‫‪ ‬أركر ًَارج شثكات انحاسة انًىسعة؟‬
‫‪ ‬يا انًمصىد تشثكة انخذيات انرلًيه انًتكايهة؟ يىضحا‬
‫يًيساتها وخصائصها؟‬
‫‪ ‬أركر يا تعرفه عٍ انشثكة انعانًية يىضحا أهى انخذيات انتً‬
‫تمذيها؟‬
‫‪ ،‬انًعهىية ‪ ،‬انثياَات ‪،‬‬ ‫‪ ‬عرف كال يٍ إتصاالت انثياَات‬
‫اإلشارات ؟ يع ركر يثال يىضح رنك؟ ويا أهى انُماط انتً‬
‫يجة يعرفتها إلتًاو إرسال انثياَات؟‬

‫‪-151-‬‬
‫‪ ‬وضح تانشكم أَىاع اإلشارات وعثيعتها ؟‬
‫‪ ‬أركر تانشكم انحاالت انًختهفة نتحىيم انثياَات إنً إشارات ؟‬
‫‪ ‬أركريا تعرفة عٍ لُىات انتراسم ؟ ويا هً األلساو انرئيسية‬
‫نها يىضحا رنك تااليثهة نكم لسى؟‬
‫‪ ‬إركر أشهرااليثهة عهً وسائظ انتراسم انًىجه (انسهكية) يع‬
‫انتىضيح تانشكم عثيعة انتكىيٍ وأشهر انتغثيمات وأهى‬
‫انًًيسات نكم َىع؟‬
‫‪ ‬إركر أشهرااليثهة عهً وسائظ انتراسم انغيريىجه (انالسهكية)‬
‫يع انتىضيح تانشكم عثيعة انتكىيٍ وأشهر انتغثيمات وأهى‬
‫انًًيسات نكم َىع؟‬
‫‪ ‬أركر تعريف انًشكهة‪ ،‬حم انًشكهة‪ ،‬يع ركر خغىات حم‬
‫انًشكهة تانتفصيم؟‬
‫‪ ‬أركر وظيفة خغىات حم انًشكهة ( انخىارزيية «‬
‫‪)»Algorithm‬؟‬
‫‪ ‬أركرتعريف نخرائظ انتذفك (« ‪ ، )» FLOWCHARTS‬ويا‬
‫أهًيتها؟‬
‫‪ ‬يا هً يفهىو خرائظ انتذفك ونًارا يتى إستخذايها ؟‬
‫‪ ‬أركر دورخرائظ انتذفك فً انتعثيرعٍ خغىات انحم نهًشكهة؟‬
‫‪ ‬أركر تانتفصيم انريىز انمياسية نثُاء خرائظ انتذفك يع‬
‫ركروظيفة كم ريس؟‬

‫‪-152-‬‬
‫‪ ‬وضح دوروأشكال أداء انشرط (‪ )Decision Symbol‬فً‬
‫يخغظ انتذفك؟‬
‫‪ ‬يا هً أهى انًعايير انًتثعة فً تُاء يخغغات انتذفك؟‬
‫‪ ‬ياهً أهى انفىائذ نخرائظ انتذفك وأوجه لصىرها؟‬
‫‪ ‬أركروظيفة وتكىيٍ انحهمات انتكرارية )‪ ) Loop‬في خرائظ‬
‫انتذفك؟‬
‫‪ ‬أركردور ال (‪ )Counter‬في خرائظ انتذفك؟‬

‫‪-153-‬‬

You might also like