Wednesday 24th April 2024
REGISTRATION
Online Fashion Store

Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2009 > Computer Science > Computer Science By Mr. Kapil Bhatia

CBSE CLASS XII

Q. 1.

  1. Name the header files of C++ to which the following function belong:
    (i) read( )          (ii) strcmpi( )
  2. Differentiate between a Call by value and Call by reference, given suitable
    example of each.
  3. Rewrite the following program after removing the syntactical  error(s), if any. Underline each correction.
               
                #include<iostream.h>
                CLASS student
    {
    int admno;
    float marks;
    public:
    student( )
    {
    admno=0;
    marks=0.0;
    }
    void input( )
    {
    cin>>admno;
    cin>>marks;
    }
    void output( )
    {
    coyt<<admno;
    coyt<<marks;
    }
    }
    void main( )
                {
                Class student s;
                s input;
                s output;            }
  4. Find the output of the following program:
    #include<iostream.h>
    struct area
    {
                int length;
                int breadth;
                int areas;
    };

void calarea(land& P1,int y=10)
{
            P1.areas=P1.leangth*P1.breadth;
            P1.areas/=y;
            P1.leangth++;
            P1.breadth++;
}
void main( )
{
area first={20,50,0},second={10,30,0};
calarea(first);
cout<<first.areas<<’#’<<first.length<<’#’<<first.breadth;
cout<<endl;
calarea(second,5);
cout<<second.areas<<’#’<< second.length<<’#’<< second.breadth;
}

e. Find the output of the following program:

#include<iostream.h>
int x=10;
void pass(int &a,int b,int &c)
{
            int x = 4;
            c + = x;
            a * = :: x;
            b + = c;
}
void main( )
{
            int y=1,x=2;
pass(y, ::x, x);
cout<<x<<’:’<<y<<’:’<<::x;
cout<<endl;
pass(::x, x, y);
cout<<x<<’:’<<y<<’:’<<::x;
}

f. In the following program:

    How many times the while loop run?

    What would be the last value of A displayed out?

 

#include<iostream.h>                                    
void main( )
         {
                     int A = 10;
                     while(++ A < 10)        
                                    {
                                                cout<<A++;
                                    }
                        }

Q. 2.

  1. Discuss the different ways by which we can declare a function in a class.
  2. Given suitable example of each.
  3. Differentiate between a data type struct and data type class in C ++. What  is the need for a constructor functionin an object?
  4. Consider the following C++ declarations and answer the questions given below:-

class alpha
{
            int x,y;

            protected:
                        void putvala( );
            public:
                        void getvala( );
};

class beta : private alpha
{
            int m,n;
            protected:
                        void getvalb( );
            public:
                        void putvalb( );
};
class gamma : protected beta
{
            int a;
            public:
                        void getdata( );
                        void showdata( );
};

  1. Write the names of member functions, which are accessible from the object of class gamma.
  2. Write the names of members, which are accessible from the member function  of class beta.
  3. Name the base class and derived class of class gamma.
  4. Name the private member functions of class gamma.

(d)        Define a class bank to represent the bank account of a customer with the following specifications:
private members:

    • name of the depositor char (20)
    • account no int
    • type of account ( s for saving, c for current account) char
    • balance amount (float)

member functions:-

    • ini( ) to initialize data members
    • deposit( )  to deposit money
    • withdraw( ) for withdraw of money. Mony can be withdraw if minimum balance > = 1000
    • display( )    to display data members

Q. 3.

  1. If    two  –  dimensional   array   C[5……9, -4…..10]  is stored  using column  2 major representation, then calculate the address of C[8,6}, if the base address is 100 and each element requires 4 bytes of memory.
  2. Suppose A,B,C are arrays of  integers  of  size M, N  and M + N respectively. 4 The numbers in array A appear in ascending order and B appear in descending order.  Give the  necessary  declaration  for  array  A,B and  C in C++. Write a user define function in C++ to produce third array C by merging arrays A an B in ascending order.
  3. Write a function to delete an element from queue containing integers.
  4. Write a function to sort an array with the help of selection sort.
  5. Evaluate the following postfix expression showing the stack contents.
                            (i)         5, 12, 4, /, -, 6, 4, +, *
                            (ii)        (false && true) && !(false || true)                    

Q. 4.

  1. Difference between functions read and write( ).
  2. Observer the program segment given below carefully and fill the blank
                            marked as statement 1 and statement 2 using seekg( ) and tellg( ) function
                            for performing the required task:
                            #include<fstream.h>
                            class employee
                            {
                                        int eno;
                                        char ename[20];
                                        public:
                                                    int countrec( );              //function to count total no of records
                            };
                            int item ::countrec( )
                            {
                                        fstream file;
                                        file.open(“employee.dat”,ios::binary | ios::in);
                                        ___________________________  // statement 1;
                                       
    int Bytes = _________________ // statement 2;

int Count = Bytes / sizeof(Item);

file.close( );
return Count;
                        }        

     c. Write a function in C++ to add a new objects at the bottom of a binary file

“Student.dat”, assuming  the  binary  file  is  containing  the  objects of the
following class:-

class student
{
            int rno;
            char name[25];
            public:
                        void enter( )
                        {
                                    cin>>rno;
                                    cin>>name;
                        }
                        void display( )
                        {
                                    cout<<rno;
                                    cout<<name;
                        }

};        

Q. 5.a. Differentiate between SQL commands DROP TABLE and DROP VIEW.  

b. Write SQL commands for statements (i) to (iv) and give outputs for SQL  queries (v) to (viii): on the basis of the table STUDENT. 

No.

Name

Stipend

Stream

AvgMark

Grade

Class

1

Karan

450.00

Medical

78.5

B

12B

2

Divakar

450.00

Commerce

89.2

A

11C

3

Divya

300.00

Commerce

68.6

C

12C

4

Arun

350.00

Humanities

73.1

B

12D

5

Sabina

500.00

Nonmedical

90.6

A

11A

6

John

400.00

Medical

75.4

B

12B

7

Robert

250.00

Humanities

64.4

C

11A

8

Rubina

450.00

Nonmedical

88.5

A

12A

9

Vikas

500.00

Nonmedical

92.0

A

12A

10

Mohan

300.00

Commerce

67.5

C

12C

  1. Select all the nonmedical stream student from STUDENT.
  2. List the name of those students who are in Class 12 sorted by stipend.
  3. List all the students sorted by Avgmark in descending order.
  4. Display a report, listing Name, Stipend, Stream and amount of Stipend received in a year assuming that the Stipend is paid every month.
  5. select MIN(AvgMark) from student where AvgMark<75
  6. Select SUM(Stipend) from student where Grade=”B”;
  7. Select AVG(Stipend) from student where class=”12A”;
  8. Select COUNT(DISTINCT) from student;

Q. 6.a. tate and verify Associative law int Boolean Algebra.

b. Write the equivalent Boolean expression for the following Circuit:

c. Write the SOP form of a Boolean Function F, which is represented by the Following truth table:

A

B

C

D

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

1
0
0
1
0
0
1
1

d. Reduce the following Boolean expression using K- Map:
F(A,B,C,D) = p(0,1,2,3,4,5,10,11,15)

Q. 7.a. What is the difference between Packet Switching and Circuit Switching?

b. Expand the following terminologies:
(i)TCP/IP
(ii)HTML

  1. CDMA
  2. WLL

c. Define network topology.

d. The Great Brain Organisation has set up its new Branch at Srinagar for its office and web based activities. It has 4 Wings of buildings as show in diagram:

Center to Center distances between various block

Wing X to Wing Z

50 m

Wing X to Wing Y

70 m

Wing X to Wing X

125 m

Wing X to Wing U

80 m

Wing X to Wing U

175 m

Wing X to Wing U

90 m

Number of Computers

Wing X

50

Wing Z

30

Wing Y

150

Wing U

15

                       

 

 

 

  1. Suggest a most suitable cable layout of connection  between the  Wings.
  2. Suggest the most suitable place to house the server of this Organisation
  3. with a suitable reason, with justification.
  4. Suggest the placement of the following devices with justification:
    1. Repeater
    2. Hub / Switch
  5. The Organisation is planning to link its head office situated in Delhi
  6. with the offices at Srinagar. Suggest the type of network for that.

Paper By Mr. Kapil Bhatia