Page 82 - Touchcode_C5_Flipbook
P. 82

C.  Step 1  Input the side                          G.
                     Step 2  Volume = side × side × side                  Take number from the user
                                                                          If number > 0
                     Step 3  Print volume                                 Then
                  4.2 Programs : Conditions                                   print “Positive number”
                  Page 61                                                 Else if number < 0
                  A. 1.   a = 6        a = 2       a=10                   Then
                         Greater      Lesser       Greater                    print “Negative number”
                         than 10      than 10      than 10                Else
                    2.  number = 49   number = 56   number = 24               print “Invalid input”
                          Number is     Number is    Number is not
                         divisible by 7  divisible by 7  divisible by 7  4.3 Programs : Loops
                                                                      Page 65
                  Page 62                                             A.  START
                    3. a. I want it     b. I don’t want it
                      c. I don’t want it  d. I want it
                    4. a. Divisible by 5  b. Divisible by 5                                                    END
                      c. Divisible by 5 and 10 d. Divisible by 5
                  B.                                                      Repeat 3 times
                       If (today is Sunday) and (cricket match)           {
                       Then                                               Move one step
                           Print “Yes”                                    Turn right
                       Else                                               Move one step
                           Print “No”                                     Turn left

                  C.                                                      }
                       If (today is Monday  or Tuesday or
                       Wednesday  or Thursday or Friday or            Page 66
                       Saturday) and (I have an exam)                 B.  1.
                       Then                                                                   2.   I am in class 5
                                                                                                   Hello
                             Print “Today is a weekday and I have                                  I am in class 5
                                                                                                   Hello
                           an exam”                                                                I am in class 5
                       Else                                                                        Hello
                                                                                                   I am in class 5
                           Print “Today is not a weekday”                                          Hello
                                                                                                   I am in class 5
                                                                         3.                        Hello
                  Page 63      Page 64
                  D.  1. Tea         F.   Number        Print
                     2. Coffee               16      COMPOSITE

                     3. Tea                  D      NOT NUMBER
                  E.   A  Output             3         PRIME          Page 67
                                             10      COMPOSITE        C.  1.
                      26   156                                                Num1
                      56   336               7         PRIME                              4          7          87
                      90   540               E      NOT NUMBER                Num2        7          5          34
                      33    99               75      COMPOSITE                Print  num2 is greater num1 is greater num1 is greater
                                             61        PRIME
                      17    51                                           2.
                                             33      COMPOSITE               Marks    45    40    55     49    85
                      10    60
                                             Q      NOT NUMBER               Result   Fail  Fail  Pass  Fail  Pass
                                                                      Challenge 4
                                                                      Do yourself




                   80      Touchcode–V
   77   78   79   80   81   82