Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 73 - 2625 PortGPt V2.1
P. 73

    Advantages of flowchart
                        Provides an approach towards solving a problem and brings visual clarity to a problem.
                        Building a flowchart means doing a kind of documentation of the code you are about to
                         build.
                        Easy to understand the logic/ debugging process of a given problem.

                                                                                                           Critical Thinking
                      Example 1:  Draw a flowchart to calculate profit and loss.
                      (Refer Example 1 for algorithm)

                     Solution:

                                                     Start

                                                   Read cost
                                                   Price (C.P.)

                                                  Read selling
                                                   Price (S.P.)

                                                                      Yes
                                                    S.P.>C.P.                   Profit = S.P. – C.P.

                                                         No

                                                Loss = C.P. – S.P.                 Print Profit

                                                   Print Loss

                                                      End

                                                                                                           Critical Thinking
                      Example 2: Draw a flowchart to print 'Above average marks' if

                      the average marks in the three subjects are greater than 60 and
                      'Below average marks' if the average marks are less than or equal
                      to 60. (Refer Example 2 for algorithm)

                                                                                           Algorithms with Block Coding  71

| 68 69 70 71 72 73 74 75 76 77 78 |