Computer Concept & Programming In C - Unit I - 11

The following are some guidelines in flowcharting.
(a)  In drawing a proper flowchart, all necessary requirements should be listed out in logical order.
(b)  The flowchart should be clear, neat and easy to follow. There should not be any room for ambiguity in understanding the flowchart.
(c)  The usual direction of the flow of a procedure or system is from left to right or top to bottom.
(d)  Only one flow line should come out from process box.


(e)  Only one flow line should enter a decision symbol, but two or three flow lines, one for each possible answer, should leave the decision symbol.


(f)  Write within standard symbol briefly. As necessary, you can use the annotation symbol to describe data or computational steps more clearly.


(h)  If the flowchart becomes complex, it is better to use connector symbols to reduce the number of flow lines. Avoid the inter section of flow lines of you want to make it more effective and better way of communication.
(i)  Ensure that the flowchart has a logical start and finish.
(j)  It is useful to test the validity of the flowchart by passing through it with a simple test data.
Advantages of Using Flowcharts: -
The benefits of flowcharts are as follows :
(1) Communication: -
Flowcharts are better way of communicating the logic of a system to all concerned.
(2) Effective Analysis: -
With the help of flowcharts, problems can be analysed in a more effective way.
(3) Proper Documentation: -
Program flowchart serve as a good program documentation, which is needed for various purposes.
(4) Efficient Coding: -
The flowcharts act as a guide or blueprint during the systems analysis and program development phase.
(5) Proper Debugging: -
The flowchart helps in debugging process.
(6) Efficient Program Maintenance: -
The maintenance of operating program becomes easy with the help of flowchart. It helps the programmer to put offers more efficiently on that part.
Limitations of Using Flowcharts: -
(1) Complex Logic: -
Sometimes, the program logic is quite complicated. In that case, flowchart becomes complex and clussing.
(2) Atterations and Modifications: -
If atteractions are required the flowchart may require re-drawing completely.
(3) Reproduction: -
As the flowchart symbols cannot be typed, reproduction of the flowchart becomes a problem.
(4) The essentials of what is done can easily be lost in the technical details of how it is done.

Example 1 : Draw a flowchart to find the sum of first 50 natural numbers.


Example 2 : Draw a flowchart to find the largest of three numbers A, B and C.                                                         (AKTU. 2008 - 09, 12 - 13)


Q.21   Write an algorithm to input the date in the dd/mm/yyyy format and prints YES if it is a valid date otherwise prints NO.                                                                           (AKTU. 2008-09)
Related Questions -
Q.        Trace an algorithm to depict logic.
Ans.    The convention used in this algorithm mostly resembles that of ‘C’ language and the date is entered as dd/mm/yyyy in which all dd, mm and yyyy are integers. We name the function as check_date. The algorithm follows.
Check_date (int dd, int mm, int yyyy)
1.         leap = 0
2.         If (yyyy > 0)
3.             If ((yyyy %4)! = 0)
4.                  leap = 29
5.             Else
6.                  leap = 30
7.             If ((mm > 0) && (mm < 13))
8.                  If (mm = = 2)
9.                      If ((dd > 0) && (dd < leap))
10.                      print YES
11.                   Else
12.                      print NO
13.               If ((mm = = 1) ¦¦ (mm = = 3) ¦¦ (mm = = 5) ¦¦ (mm = = 7) ¦¦ (mm = = 8)
14.              ¦¦ (mm = = 10) ¦¦ (mm = = 12))
15.                   If ((dd > 0) && (dd < 32))
16.                      print YES
17.                   Else
18.                      print NO
19.               If ((mm = = 4) ¦¦ (mm = = 6) ¦¦ (mm = = 9) ¦¦ (mm = = 11))
20.                   If ((dd > 0) && (dd < 31))
21.                      print YES
22.                   Else
23.                      print NO
24.          Else
25.               print NO
26.      Else
27.          print NO
28.      End.



                                                                                              Next Page