Page 570 - Cs_withBlue_J_C11_Flipbook
P. 570

{

                  p=m+n-1;
                  if(p%3 == 0)

                  q += p;
                  else

                  q += p+4;
                  }

                  }
              (iii)  With reference to the code given below, answer the questions that follow:
                  int find(int m, int n)

                  {
                    if(m%n==0)

                         return n;
                    else

                         return(find(n,m%n));
                  }
                  (a) What will be returned by find(9,6)?                                                           [2]

                  (b) State in one line what does the function find(int , int) do?                                  [1]
              (iv)  Rewrite the codes by rectifying the errors in the given segment and also write the output.     [1+2]
                  String = "Computer Science",;

                  System.println(x.substring(1,5)+x.charAt(15));


                                                         PART II – 50 MARKS
                                    Answer six questions in this part, choosing two questions from
                                        Section A, two from Section B and two from Section C.
                                                             SECTION - A

                                                      Answer any two questions
              Question 3:
              (i)  The selection of students for a competition in a school depends on the following criteria:       [5]

                  Students is of the same school and has scored more than 60% marks.
                                                                   OR

                  Student is of the same school and has scored less than 60% marks but has taken active part in co-curricular
                  activities.

                  The inputs are:

                       Inputs
                   S               Student is the same school
                   C               Has taken active part in co-curricular activities



                568568  Touchpad Computer Science-XI
   565   566   567   568   569   570   571   572   573   574   575