Page 42 - tp_Modula_v2.0
P. 42

3.  x = 31

                           if x > 10:
                             print("Above ten")
                             if x > 20:

                               print("and also above 20!")
                             else:
                               print("but not above 20.")

                      4.  a = 200
                           b = 33
                           if b > a:

                             print("b is greater than a")
                           else:
                             print("b is not greater than a")
                                                                                                     Initiative

                  G.   Application based question.
                        Shweta was writing a program in which she wanted to execute a particular set of statements depending
                      upon a particular test condition. Which type of statements can she use for this?



                                                    In the lab                                  Technology Literacy



                     Write a program to:
                     1.   check whether the year input by the user is a leap year or not. (A year is a Leap year, if the year
                         is a multiple of 4.
                     2.   calculate the area of square or circle according to the given input by the user. If the input is 1,
                         then calculate the area of square, else find the area of a circle. Ask the user to input the values
                         for square or circle, based on the input.
                     3.  find whether the given character is a vowel or not.

                     4.  check if the input number is positive or negative.
                     5.   input three numbers from the user, then print ‘You Won’ if the sum of input numbers is greater
                         than 1000.





                   Teacher's Corner

                  1.   Discuss all the topics covered in this chapter with the students.
                  2.   Tell the students, how to use indentation to define the body of the conditional statement.









                   40     Touchpad MODULAR (Version 2.0)
   37   38   39   40   41   42   43   44   45   46   47