Tuesday, July 17, 2012

CS201 FINAL TERM PAPER DATE: 16-JULY-2012



CS201 FINAL TERM PAPER

 DATE: 16-JULY-2012          TIMING : 11 AM TO 1 PM



Classes defined inside other classes are called ________ classes

       ► looped

       ► nested

       ► overloaded

       ► none of the given options.

When the compiler overloads the assignment (=) operator by default then __________

       ► compiler does member wise assignment.

       ► compiler does not allow default overload of assignment (=) operator

       ► member of the class are not assigned properly

       ► None of the given options

YA QUESTION ESKSI AUR TARHAN POCHA THA JS KA JAWAB THA MEMBER WISE ASSIGNMENT

  MCQ/Q:         Copy constructor       KY BOHAT QUESTION THAY ES KI CONCEPT CLEAR   HONY CHAIN

  MCQ:           stream insertion and stream extraction operators







   MCQ:           Unary and binary operators

    Q: 2/ 3 number ka tha            

     How many bytes will the pointer iPtr of type hexadecimal aur sath mai value dee hoi thee

        (x—ff51) and jump to the next position and what is the address  iPtr += 4 ;



   Which programming tool is helpful in tracing the logical errors?

            Debugger

A template function must have at least ---------- generic data type

        ► Zero

        ► One

        ► Two

        ► Three


Dynamic memory allocation ky ab kuch question thay MCQ b aur 2 number ki b


Constructor enclose the other constructor and tells the how’s destructor call


For non-member operator function, object on left side of the operator may be

        ► Object of operator class

        ► Object of different class

        ► Built-in data type

        ► All of the given options



           The operator function will be implemented as _____, if obj1 drive the - operator whereas obj2 is

             passed as arguments to - operator in the statement given below.

              obj3   =   obj1 -   obj2;

      ► Member function

      ► Non-member function

       ► Friend function

       ► None of the given options




          Which one of the following is the declaration of overloaded pre-increment operator implemented as

         member function?

 

       ► Class-name operator +() ;

        ► Class-name operator +(int) ;

        ► Class-name operator ++() ;

        ► Class-name operator ++(int) ;check from book please


 The static data members of a class are initialized _______

       ► at file scope

        ► within class definition

        ► within member function

        ► within main function



life time of static variable?




Es tarhan ka question tha lakin values change thee

What will be the output of following function if we call this function by passing int 5?

template <class T>

T reciprocal(T x)

{

return (1/x);

}

Answer:-

0

The output will zero as 1/5 and its .05 but conversion to int make it

zero
Above is prototype of template class so assume passing an int and
Post increment and pre increment k syntax btana thay(2 marks)

Answer:

Classname operator ++(); ---- pre increment
Classname operator ++(int) ---- post increment

Es ka pocha tha copy constructor  or assignment
Matrix m1 = m2;
How many arguments a Unary Operator take? Can we make a binary operator as unary operator?
Answer:-
Unary operator takes only one arguments like i++ or i-- (Post increment or post decrement operators for
integers) or ++i,--i (Pre increment or pre decrement operators for integers) ,we can not make Unary
operator as binary or binary as Unary operator
Simple function and class function explain


5 mark ka ak question th
To calculate the tax 5%  and 7 % to deduct the salary using the switch statement
Full concept of Midterm aur ya question book mai hay kafi ziyda milta hay lakin values change thee lakin idea same tha
5 marks ka 2nd question
-Class String
-Delete pointer
-New sy allocate memory
-Strcpy(s2,s1)

Main()

   -String  s, *sptr
   Kuch assignment ki hoi thee baki yad nahi Kai problem kahn thee aur ya likha hoa tah kai bad
   programming hay ap khud program lkihoo
   And program mai sy error findout kerny thay aur khud program batana tha kai consi technique 
  bather hhay
*this ponter ka pocha tha
wish you all the best

Nasia Aslam

0 comments:

Followers

Copyright VirtualHelp 2011. Powered by Blogger.

Blog Archive

Search Your Subject