Page 84 - Digicode_AI_class_6
P. 84

Let’s see an example to find the word ‘Orange’ in a dictionary:
            1.   Find the dictionary section with the first letter of the word, ‘o’.

            2.   Within the list of words starting the first letter ‘o’, find the section having the second letter of the
               word ‘r’.
            3.   You need to do this process again with the third letter ‘a’, fourth letter ‘n’,  fifth letter ‘g’ and sixth
               letter ‘e’, until you finally reach the word ‘orange’ in the dictionary and then find its meaning.
            So,  to  find  the  meaning  of  a  particular  word  in  a  dictionary,  you  need  to  follow  a  set  of  steps.
            Similarly, before writing a program for a given problem, it is important to define a set of steps which
            need to be followed to solve the problem successfully. This sequence of the set of steps is called an
            algorithm.
                                                    Q


                                                        f         ANSWERS


                                                A                 b      K


                                              B         C                   a


















                     The first computer game 'Spacewar' was created in 1961, by MIT programmer
                     Steve Russell and his team.



            Pseudocode

            Pseudocode is used to describe the steps of an algorithm in a human-understandable language. It has
            no syntax and can be easily understood by a layman. So, pseudocode is an informal way of writing
            programs in which there is no need to think about semi-colons, curly brackets.

            Characteristics of Pseudocode

               It uses structured english statements.
               It can be reviewed/verified easily to see if it generates the desired outcome.

                You can focus on all possible scenarios. So, this helps you to understand the potential problems
               that might come up later.
               Writing pseudocode will help to write your code much easier.




                 82    DigiCode AI-VI
   79   80   81   82   83   84   85   86   87   88   89