‎2008 Mar 05 4:44 AM
hiii friends in procedural programming we usually take a top-down approach using a techniq divide an conquer.....
wt does it mean plz explain it.....
points will be regarded....
‎2008 Mar 05 5:58 AM
Hi,
The following link will be useful.
http://pages.cs.wisc.edu/~cs354-1/cs354/karen.notes/basics.html
Regards
Vadi
‎2008 Mar 05 6:05 AM
Hi
Unstructured Programming
Characteristics
1)Consists of only one main program.
2) The program stands for a sequence of commands which modify data that is global throughout the whole program.
report ysubdel.
DATA : sal type p decimals 2,
itax type p decimals 2,
net_sal type p decimals 2 .
sal = 12000.
IF sal lt 5000 .
itax = 0.
ELSE.
itax = sal * '0.01'.
ENDIF.
net_sal = sal - itax.
write:/5 sal , itax , net_sal.
sal = 3500.
IF sal lt 5000 .
itax = 0.
ELSE.
itax = sal * '0.01'.
ENDIF.
net_sal = sal - itax.
write:/5 sal , itax , net_sal.
In above program we observe the follwing disadvantages.
Disadvantages
Difficult to manage once the program becomes large.
Same sequence of statements are repeated at multiple places, if they are needed at multiple locations.
Procedural Programming:
Programmer combines related sequences of statements into one single place, called procedure.
A procedure call is used to invoke the procedure.
After the sequence is processed, flow of control proceeds right after the position where the call was made.
report ysubdel.
DATA : sal type p decimals 2 ,
itax type p decimals 2 ,
net_sal type p decimals 2.
sal = 12000.
PERFORM sub_calc_tax USING
sal itax net_sal.
sal = 3500.
PERFORM sub_calc_tax USING
sal itax net_sal.
FORM sub_calc_tax USING P_SAL P_ITAX P_NET_SAL.
IF p_sal lt 5000 .
p_itax = 0.
ELSE.
p_itax = sal * '0.01'.
ENDIF.
p_net_sal = p_sal - p_itax.
ENDFORM.
Object Oriented Programming:
Classes and objects are used to model real world entity.
Methods inside the classes perform the functions.
Data used by the classes are protected between them
Object Oriented Approach - key features
1. Better Programming Structure
2. Real world entity can be modeled very well
3.Stress on data security and access
4. Data encapsulation and abstraction
5. Reduction in code redundancy
If it is helpful rewards points
Regards
Pratap.M