Page 102 - Computer Science Class 11 Without Functions
P. 102

Input:
            nState: the number of states
            BPL: list of population below poverty line
        Process:
            Find the total population below poverty line
            and divide by the number of states
        Output:
            average population below poverty line
        The pseudocode representation of this algorithm is as follows:
        input nStates, BPL
        totalBPL = 0
        for i = 1 to nStates

            totalBPL = totalBPL + BPL[i]
        end-for
        average = totalBPL / nStates
        print average
        The flowchart representation of the above algorithm is as follows (Fig 4.11):

                                            Start



                                   input nStates, BPL[1..nStates]


                                         totalBPL = 0




                                                                         i = 1





                                                                      i<=nStates


                                        False                               True

                                                                 totalBPL = totalBPL + BPL[i]



                                                                        i = i + 1



                                     average = totalBPL/nStates


                                          print average



                                             Stop

                         Fig 4.11: Flowchart to compute the total population and average of below poverty line
         100   Touchpad Computer Science-XI
   97   98   99   100   101   102   103   104   105   106   107