Page 270 - AI Ver 1.0 Class 9
P. 270

Task



             Do you think of any other way of making a different kind of sandwich? If yes, write the steps in the form
             of an algorithm .














        Let us look at some examples of algorithm.

        1.  Input the temperature in Fahrenheit and convert it into Celsius and display it.
           Start
           Input Temp in Fahrenheit
           C=5/9*(Temp-32)
           Display C
           Stop
        2.  Input the radius of a circle and calculate its area.
           Start
           Input radius
           Area=3.14*radius*radius
           Display Area
           Stop
        3.  Input an age and check whether eligible for driving licence or not.

           Start
           Input Age
           If the Age is more than or equal to 18 then
           Display " Eligible"
           Otherwise
           Display " Not Eligible"
           Stop
        4.  Display even numbers from 2 to 20.
           Start
           N=2
           Repeat for N is less than or equal to 20

           Display N
           N=N+2
           Goto repeat till N reaches 20
           Stop




                  268   Touchpad Artificial Intelligence-IX
   265   266   267   268   269   270   271   272   273   274   275