You are on page 1of 60

| 



@ 


 

 
   

 

@ 

@




 


@ 





@
  

@ 

@



@ 


 
 @




  

@ 






|   
| 

@ !

@ " 


@ 

#   




u 

 
   
 

    
 

 
 
 

|    |

 
|$ "

% " 
 &
' |" 
 &
'   &(
' )
&(
*


u 


 
 
    
      
   
  
 

 
 
 

|    



@


% |     

' + ,
' " - 
.
' -
 
.


''+  


*

*
" 
' )

*


u 


 
 
   
  
 

 
 
 

|    


   

'
'
'

'

@


% ,,,   

+ ,
+/ 
 ,
" -/ 

,,,.
' -
 
.


''+  



*

'
 
/ 

*
" 
)

*




 |   

@ 0

/
 &  

|    



@


% |     

' + ,
' " - 
.
'@

*
" 
' )

*


   



@


% 



' -
 
.


'+  

*

*




|
|   

@ ,

+ 

@ 

# 

@ 

+
 

@ %

*1  


 

@ %

*1  


 

@ 

+
 
  

@ "%
2 @ "3
m

The  " is a means of visually presenting the flow


of control through an information processing systems,
the operations performed within the system and the
sequence in which they are performed.
Ot is a graphic representation of how a process works,
showing, at a minimum, the sequence of steps.
Flowcharts are generally drawn in the early stages of
formulating computer solutions.

@ "-/
4.%
 
 "
  "%
Flowcharts are usually drawn using some standard
symbols; Some standard symbols, which are frequently
required for flowcharting many computer programs are
shown below

    

( & 
indicates the beginning and
end points of an algorithm.
# ( & 
shows an instruction other than
input, output or selection.

 ( & 
shows an input or an output
operation.
 5  6$( & 
indicates input from or output to
disk storage.
#
 ( & 
shows hardcopy printer
output.

O 
O   




     


+
( & 
shows a selection process
for two
way selection.
$ 

 
provides continuation of a
logical path on another page.

$


 
provides continuation
of logical path at another point in the same
page.

@ "

indicate the logical sequence of
execution steps in the algorithm.

O 
O   




@ "-/
4.%
|  
@ "
( & %
m

) 
& 1
use it to represent an event which occurs automatically.
)
 & 1
use it to represent an event which is controlled within
the process. Typically this will be a step or action which
is taken.
 

use it to represent a decision point in the process.
/ 
use it to represent a point at which the flowchart
connects with another process.

|7| |*+$@8+ 
@$2/9|) +%
m

/ 

% Flowcharts are better way of
communicating the logic of a system
*  
( % roblem can be analyzed in more
effective way.
#   

% Flowcharts serve as a good
program documentation
*  
/ 
% Flowcharts act as a guide or blueprint
during the systems analysis and program development
phase.

|7| |*+$@8+ 
@$2/9|) +-/
4.%
m

# &
% Flowchart helps in debugging
process.
*  
#  :


% The maintenance of
operating program becomes easy with the help of
flowchart.

  
'  

  
  

2
  
  

2
  
  

2
  
  

Flowchart for finding the sum of first five natural numbers (


i.e. 1,2,3,4,5):

@ "-*1 .%
Flowchart to find the sum of first 50 natural numbers.

@ "/ 
 " 
 &%
+

)|;

=

|<;


#
;

#
|
*


@ " 
 

 &|;
/%

OOTATO S F USO
F ARTS:
m

/ 1  %Sometimes, the program logic is quite


complicated. On that case, flowchart becomes complex
and clumsy.
|

:  
%Of alterations are
required the flowchart may require re
drawing
completely.
) 
%As the flowchart symbols cannot be
typed, reproduction of flowchart becomes a problem.

O 
m

Oseudocode is a shorthand notation for programming


which uses a combination of informal programming
structures and verbal descriptions of code.
On general, pseudocode is used to outline a program
before translating it into proper syntax. This helps in the
initial planning of a program, by creating the logical
framework and sequence of the code. An additional
benefit is that because pseudocode does not need to
use a specific syntax, it can be translated into different
programming languages and is therefore somewhat
universal. Ot captures the logic and flow of a solution
without the bulk of strict syntax rules.
O

is an artificial and informal language that
helps programmers develop algorithms. Oseudocode is
very similar to everyday English.

O   
 
m

*1 % rite an algorithm to determine


a students final grade and indicate whether it
is passing or failing. The final grade is
calculated as the average of four marks.

O   
 
#  :
m O  
  
m       


m   
  O

  !!

O   
 
m
m

etailed Algorithm
Step 1:
Onput 1,2,3,4
Step 2:
RAE j (1+2+3+4)/4
Step 3:
if (RAE < 50) then
Orint FAO
else
Orint OASS
endif

 

 
  ! 

 O 


m

Oroblem solving and design should be done


independent of programming.
ode significantly clouds the design process..
Ot is very difficult to see the design and
address design issues when coding
esign needs to take place in a mode which
  " code influence


1

reate a structure chart


based on the main
item,
 T programming
requirements

Omprove readabililty
of the code by
incorporating
functions.

odify structure chart


based on the
programming
requirements.
2#  .

3
rite code to
implement the
top
down design.
  
 
 
$

   O " 


*1 %#+ / 
('
u "O      $
ational Oarcel Service (OS) specializes in nationwide delivery of small packages. OS will not accept
any packages whose largest dimension is greater than 3 feet or whose weight exceeds 50 pounds.
The charge for shipping a parcel is $0.75 plus an amount based on package weight as follows:

 

 
  
   
   

There is an additional $1.00 charge if the volume of the package exceeds 18 cubic feet. rite a program
that will read the dimensions of a parcel (in feet) and its weight (in pounds) and then compute and print
the postage due. Of the package is rejected, an appropriate message should be printed.

    

!"  


    # 

O # 
ational Oarcel Service
Oarcel *
Size

ength

idth

Shipping Status

eight

Acceptable

epth

ot Acceptable

harge

eight harge

t<=20

20<t<=40

t>40

Volume harge

Vol<=18

Vol>18

0.75

!  O #
m

m
m

ur natural view of the problem domain


may not match the requirements.
There are multiple views of anything.
ther views are not wrong, but do provide
insight into the structure we expect and
perceive.
On  problem we need to adjust for a
single parcel.

Oarcel elivery
(adjust to one package)
Oarcel
Size

ength

idth

Shipping Status

eight

Acceptable

epth

ot Acceptable

harge

eight harge

t<=20

20<t<=40

t>40

Volume harge

Vol<=18

Vol>18

0.75


Adapt the structure chart
to accommodate the
program specifications:
 A $#$2 *+ 

Oarcel elivery

Adjusting Structure hart for Orogram (Top


own) esign
ompute Oostage
etermine Acceptability

Onput Oackage Onfo

Size

ength

eight

idth

epth

ot Acceptable

Acceptable

ompute harge

ompute
eight harge

t<=20

20<t<=40

t>40

t_chrg=
t*0.08

t_chrg=
t*0.1

t_chrg=
t*0.15

utput harge

ompute
Volume harge

Vol<=18
Vol_chrg=
0.0

Vol>18
Vol_chrg=
1.0

utput Rejection
essage

ompute
Total harge

harge=
t_hrg+
Vol_hrg+
0.75

You might also like