Page 94 - Computer Science Class 11 With Functions
P. 94

Variable: A variable is a name for a sequence of memory locations.


        A  flowchart  is  a  pictorial  representation  of  an  algorithm.  Some  common  symbols  used  in  a  flowchart  are  as
        follows:

                Symbol Name            Symbol usage                           Description


                                  Start/Stop              Used to depict the start and stop of an algorithm


                                  Process                 Used to depict some arithmetic operation



                                  Input/Output            Used to depict Read/Input and Write/Print



                                  Arrow                   Used to connect shapes depicting the flow of control






                                  Decision box            Represents a condition that may yield True or False.



                             The above algorithm may be represented as the following flowchart (Fig 4.2):



                                                        Start




                                               Input principal, rate, time





                                                     principal × rate × time
                                            interest =
                                                             100



                                                     Print interest





                                                        Stop


                                         Fig 4.2: Flowchart for computing simple interest
        Below, we show a translation of the above description of the computation of simple interest into Python:

        principal = int(input('enter Principal amount: '))
        rate = int(input('enter interest rate per annum: '))



          92   Touchpad Computer Science-XI
   89   90   91   92   93   94   95   96   97   98   99