APSDK
  • APSDK Building
  • APSDK Students
  • APSDK Primary Wing
  • APSDK-Bird's Eye View
  • APSDK
  • TAPSFEST ’16 – Avant Garde


   Latest News
Please check the Academics Menu on top for CLASS XI SECTION ALLOCATION.Queries regarding section change will be resolved on the first day of school reopening.
  

 

   Annual Sample Paper          

       The Army Public School

ANNUAL EXAM - Class XI

Computer Science

M.Marks – 70                                                                         Time –3 Hour

 

Q1. Explain the and differentiate the following  (Attempt any four )      ( 8 )

i)      Default and Constant arguments. 

ii)     Function definition and prototype.

iii)    Local and Global variables

iv)   While and Do-While loops

v)    Integer array and Character array

 

 

Q 2 Give  the use and name of header files to which following

       inbuilt functions belong to : ( Any four )                                     ( 1 ½ X 4 = 6)

    1) strcat( )   2) strcmpi( )    3) pow( )     4) fmod( )     5) isupper( ) 

 

Q3. Find syntax errors (if any) in the following programs (Assuming all the header file

       are present) and rewrite the corrected programs:                                   ( 4 )

a)     a)  # include <iostream.h>

int val=10;

int divide (int);

void main( )

 { int n=20;

    val=divide( n );

    cout<<”\n”<<val;

}

divide (int x)

{

  return(x/val);

}

 

 

b)    void main( )

{ int P[n] ,Q,Num=4;

  Q=9;

  float r=2.5;   

  for(int j=Num-1 ; j>=0 ;r>=2.5; j--)

  switch(r++)

   {

     case 0:

     case 2.5: cout>>P[ j ]*Q<<endl<<endl; break;

     case 3.5:

     case 4.5: cout<<P[ j ]+ Q;

   }

}

          

          

 

Q4. Declare a structure employee to store information about 50 employees of an

       organization consisting of the following data elements :                     ( 6 )

       Data Item                               Type                                Width

        Name                                     char                                  20

        Dept                                       char                                  20

      Yearswrkd                                 int

Write a program to print the names of those employees who have completed at least one year of service.

 

Q5. Write the output of the following:                                                         ( 6 )

a)    void main( )

{ int i=3,j;

  while( i )

  {

     cout<<”i = “<<i<<’  ’;  

       for( j=0 ; j<i ; j++)

       cout<<”j= “<<j<<” “;

     cout<<’\n’;

      i--;

}

}

 

b)    int global=10;

void func(int &x,int y)

 { x=x-y;    y=x*10;

   cout<<x<<’, ‘<<y<<’\n’;

 }

 void main( )

{ int global=7;

  func(::global , global);

  cout<<global<<’, ‘<<::global<<’\ n’ ;

  func(global, ::global);

  cout<<global<<’, ‘<<::global<<’\ n’ ;

}

 

c)    void change (int x[4] , int k)

{ x[k]=x[k] * k;

}

void main( )

{ int x[ ]={11,21,31,41};

  for(int k=0 ; k<=4 ; k++)

   { change (x , k );

     cout<<x[k]<<”\n”;

    }

           }

 

Q6. Write the function definitions for the following:(Any four ):              (4 X 4=16)

a)    A function series ( ) to print the sum of :

x +x2 + x4 + x8 + -----------------   xn

                                   

b)    A function swap( ) to interchange the values of integers a and b input by the

user.Print the changed values in the main.

 

c)    A functiona diagonal( ) to print only the diagonals, in a tabular format, of a two dimensional integer array P. Also print the sum of both the diagonals in the last line.

 

d)    A function count( ) to count and print the number of vowels in a string.

 

e)    A function transpose( ) to transpose the elements of an array P[ 3] [ 5]

 

 

 

 

Q7. Write a program that inputs the marks of N students in 2 subjects and provides

        The grades as follows :                                                                          ( 5 )

          Average                                                                   Grade

          80 and above                                                             A

          70 and above                                                             B

          60 and above                                                             C

          40 and above                                                             D

          Below 40                                                                    E

       

Q8. Write an appropriate switch case statement that will examine the value of an integer    temp and print one of the following messages:                           ( 3 )

i)              ICE  , if the value of temp is  0

 ii)WATER , if the value of temp is  30

iii)STEAM  ,  if the value of temp is  100                                                     

      iv)AIR , if the value of temp is any other 

                                                                    

  Q9. Write a program to input two strings P and Q. Concatenate string Q to P and

       reverse the concatenated string without using string reverse function.  ( 4 )

 

Q10.Evaluate the following and write the result :                                           ( 4 )

 

a)    int a=10,b=6,c=4;

      a<b && a>c || (b+7 > c-3)     

b)    int i=18, j=15, k;

k = (j==15)? i : j;

cout<<k<<endl;

c)    int j=10,k=8,p=-3;

i) ( j * p) % k                   ii) j * ( k/p)

    b)   cout<< a++ << a++ << - -c << b++ << d++ << d- - << - -d << --c ;

                                               ( if a=6, b=2, c=4, d=5 )

 

 Q10. Write a program to print the sum of all even numbers and the sum of all odd

         numbers out of n number of integers input by the user.                         ( 4 )

 

 

Q11.Write a program to input sales of three salesmen for four months.         ( 4 )

        Print the complete data in a tabular format with total sales of each salesman

        row wise and total sales for each month column wise.

 

 

 

 
Alumni Login
     Username
     

     Password
     

Remember me
     

  Forgot login?       Register