Page 236 - CA_Blue( J )_Class9
P. 236

C.  Answer the following questions.
                     1.  What are different parts of a loop?
                     2.  Define two categories of loops.
                     3.  Differentiate between Infinite loop and finite loop.
                     4.  What are delay loops? Explain with example.
                     5.  What is interconversion of loops?

                  D.  Assertion and Reasoning based question.
                      Assertion(A): A loop is a programming construct that does not repeat a set of statements until a certain condition is met.
                      Reason(R): A loop can be repeated any number of times, it depends on the user's requirements.
                      (a)   Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
                      (b)  Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
                      (c)   Assertion (A) is true and Reason (R) is false.
                      (d)  Assertion (A) is false and Reason (R) is true.
                                                                                      21 st   #Problem Solving & Logical Reasoning
                  E.  More unsolved programs                                        Century   #Interdisciplinary
                                                                                     Skills
                     1.   Write the programs in Java to display the following series:
                         a.  1,3,5,7, 9, ……99                           b.  20,18, 16, …….2
                         c.  2,4,8,16………256                             d.  1/3,  2/6,  3/9,…10/30
                         e.  1,12,123,1234, 12345                       f.  1,11,111,1111,11111,111111
                     2.   Write the program to calculate the result of the following series:
                         a.  s=1+4+9+16+25                              b.  p=10*9*8*7…..*2*1
                         c.  s=1+11+111+1111+11111                      d.  s=10+20+30+40+50+…..+100
                         e.  p=1/2*  2/3*  3/4*…*9/10                   f.  s = 2 + 5 + 10 + 17 + ... nth term
                     3.   Write a program to input a number and check whether it is a Neon number or not. If a number such that the sum of
                         digits of the square of the number is equal to the number, then it is called a Neon Number.
                         Example: 9 = 9 * 9 = 81 = 8 + 1 = 9
                     4.   Write a program to input a number and print the digits separated by a comma (,).
                         Example: n=3456
                         Output:   6,5,4,3,
                     5.   Write a program to input a number and display the new number after reversing the digits of the original number. The
                         program also displays the absolute difference between the original number and the reversed number.
                         Sample Input: 194
                         Sample Output: 491
                         Absolute Difference= 297
                     6.   Write a program to input a number and check whether the number is a Disarium Number or not.
                         A number will be called Disarium if the sum of its digits powered by their respective positions is equal to the original
                         number. Some Disarium numbers are 89, 135, 175, 518
                                                            1
                                                                 3
                                                               2
                         For example 135 is a DISARIUM, Workings 1 +3 +5  = 135
                     7.   Write a program to print the result of the following series where the unknown values are to be accepted by user.
                                      3
                               1
                                  2
                                         4
                         a.  s= a  + a  + a  + a  + ……+ a n
                               2
                                   2
                                        2
                         b.  s = x  + 2x  + 3x  + …. + nx 2
                                     3
                                   2
                               1
                         c.  p= 1  * 2 *3 …. *n n
                         d.  s = 1 + 2 + 4 + 7 + 11 + 16 + …. + n
                                           1
                              2
                         e.  s= +  4 +  6  + .... + !10
                             !2 !4 !6
                         f.  a  +  a  +  a  + .... +  a
                            2  4  6      10
                         g.  s=a -a +a -a +a …a n
                                2
                              1
                                   3
                                        5
                                     4
                         h.  p=(x+1) *(x+3) *(x+5) *…. *(x+n)
                   234    Touchpad Computer Applications-IX
   231   232   233   234   235   236   237   238   239   240   241