Page 139 - TrackpadV5.1_class7
P. 139

Binary numbers can also represent text characters through the American Standard Code for
                 Information Interchange (ASCII). For example, the binary code for the ASCII uppercase letter 'A'
                 is 1000001.


                      PURE       ASCII is made up of 128 symbols in the character set. These symbols consist of letters (both
                      FACT       uppercase and lowercase), numbers, punctuation marks, special characters and control

                                 characters.



                           CONDITIONS IN A PROGRAM

                 While writing a program, we need to make certain decisions based on the logic of the program.
                 Such situations are called conditions. Conditional statements are used in a program to instruct
                 the computer to make a decision. The result of a condition will always be either True or False.


                 IF-THEN-ELSE                                             Monarch butterflies migrate thousands

                 The program executes  the  statements  written            of miles by using environmental cues
                 inside the IF block when the condition is True. If the     and internal compasses, similar to
                 condition  is  False, the  statements  written  inside     navigation algorithms that use data
                 the else block will be executed. A block refers to a        and maps to find optimal routes.

                 section of code that is grouped together.
                 Look at these examples:

                  Example 1:                                               Example 2:

                  READ Subject                                             READ marks
                  IF Subject = "Maths" THEN                                IF marks > 50 THEN
                      PRINT "Take out Maths book & notebook"                   PRINT "Pass"

                  ELSE                                                     ELSE
                      PRINT "Check timetable"                                  PRINT "Fail"

                  Example 3:                                               Example 4:
                  READ Rain                                                READ age
                  IF Rain = True THEN                                      IF age >= 18 THEN
                      PRINT "Carry an umbrella"                                PRINT “You are eligible to vote.”
                  ELSE                                                     ELSE
                      PRINT "Do not carry an umbrella"                         PRINT “You are not eligible to vote.”




                      Tick ( ) if you know this.

                      ▶  When data is processed it is called information.
                      ▶  ASCII stands for American Standard Code for Information Interchange.




                                                                                            Algorithmic Intelligence  137
   134   135   136   137   138   139   140   141   142   143   144