Page 90 - TCS ICT Book 8
P. 90

The City School  2021-2022




             Logical Operators


             Logical operators are similar to Boolean expressions that return a boolean result.
             These operators are called binary because they acquire two operands.



                             Operator                            Meaning

                         AND                 Both sides must be true
                         OR                  One one the two conditions must be true

                         XOR                 One side or other must be true but not both
                         NOT                 Negates truth



             4.10.  Looping Statements


            In computer programming, a loop is a sequence of

            instructions that is repeated until a certain condition
            is reached. An operation is done, such as getting an

            item of data and changing it, and then some condition
            is checked such as whether a counter has reached                 As of 1st quarter 2020, Google Play
                                                                             store contains 2.9 million apps, while
            a prescribed number. In Visual Basic, we have two                Apple AppStore is the second-largest
                                                                             app store with approximately 1.85
            different structures that support repetitions, or loops          million available apps for iOS.

            as they are called in programming languages.

             For...Next Loop


             What if we want to add all the integers from 1 to 50? Of course, we are not going to
             start writing 1+2+3+…, we are going to program the computer to do the same thing

             using loops.
             Follow the steps below to create a program using Loops.


            1.  Create a new form. Drag two labels and one

                button from the toolbox panel and place on the
                form.
            2.  Set the text property of first label to

                1+2+3+...+50:

            3.  Set the text property of the second label to
                result and set its name property to lblResult.










                                                                                                                90
   85   86   87   88   89   90   91   92   93   94   95