We are Permanently Move to vupk.net Please Join us there.

CS201 FINALTERM Solved Spring 2009


FINALTERM EXAMINATION
Spring 2009
CS201- Introduction to Programming (Session - 1)


Question No: 1    ( Marks: 1 )    - Please choose one
 To access the data members of structure _______ is used.
       ► dot operator (.)

       ► * operator

       ► à operator

       ► None of given.


Question No: 2    ( Marks: 1 )    - Please choose one
 What does 5 ^ 6 , evaluate to in decimal where ‘^’ is Exclusive OR operator?

       ► 1
       ► 2
       ► 3
       ► 4
   
Question No: 3    ( Marks: 1 )    - Please choose one
 If constructor contains a return statement in its body then compiler will give __________
       ► No error

       ► Syntax error

       ► Logical error

       ► Run time error


   
Question No: 4    ( Marks: 1 )    - Please choose one
  We can use New keyword inside of Class Constructor.

        True
       ►False
   
Question No: 5    ( Marks: 1 )    - Please choose one
 When an operator function is define as member function for a Unary operator then the number of argument it take is/are,

        Zero

        One

        Two

        N arguments


   
 The declarator of Plus (+) member operator function is


CS201 Subjective Final Term Solved

                                                        Subjective Solved
 
Question No: 30 ( Marks: 2 )
What are the two types of conversion for user-defined data types?
There are two types of conversion: implicit and explicit.

Question No: 31 ( Marks: 2 )
Give the general syntax of class template.
The syntax of the template class is
template
class class-name()
{ definition of class };

Question No: 32 ( Marks: 2 )
What is a constructor in class?
The name of this function is same as the name of the class, having no return type. This function is called constructor.

Question No: 33 ( Marks: 2 )
Is there a way to increase the size of already allocated memory chunk ? Can the same chunk be increased or not?

Can the same chunk be increased or not? The answer is yes. we can reallocate the same memory with a new size according to our requirement. The function that reallocates the memory is realloc.
 
Question No: 34 ( Marks: 3 )
What is the difference between structure and class?.
The ONLY DIFFERENCES between classes and structures are
1) classes DEFAULT to having private members. Structures DEFAULT to having public members. These defaults can be changed so classes can be made to work like structures and vice versa.

2) classes DEFAULT to inheriting privately from base classes. Structures DEFAULT to inheriting public from base classes. These defaults can be changed so classes can be made to work like structures and vice versa.

Question No: 35 ( Marks: 3 )
How many arguments does binary member operator function and binary non- member operator function take?
When an operator function is defined as member function for a binary Plus (+)
operator then the number of argument it take is/are

Question No: 36 ( Marks: 2 ) - Write Program
Find the error in the given code for ( int i=0; imRows; i++)
{
for(int j=0; jumCols; j++)
{
elements[i , j] = m.elements[i][j];
}
}

Question No: 39 ( Marks: 10 ) -
What is Standard Template Library (STL) also describe its advantages?
The standard template library is the collection of functions of very common use. Their every day use is so important that two researchers wrote a whole library of these functions. This library is a part of the official standard of C++. It is called STL i.e. Standard Template Library. As a library, it is a tested code base. Some one has written, tested and compiled for the ultimate use of programmers. We can use these templates and can implement different concepts for our own data types. Equally is true about the use of the array data type. Our code will become very small with the use of this tested facility. Similarly, there is no bug or error in it. Thus, if we have a tested and tried code base, we should try our best to write programs by using it. STL is a lot of important code, pre-developed for us. It is available as a library. We can write programs by using it. Thus our programs will be small and error free

CS201 Final Term Subjective Free Usefull Questions

1) Definition of Manipulators [2 ya 3 numb]
2) Definition of 'if' and 'switch' Statement [3 ya 5 marks]
3) Is It possible to overload new and delete operators [2 ya 3 marks]
4) Definition of 'endl' and '\n' [2 ya 3 marks]
5) Definition od Code Optimization [2 ya 3 marks]
6) Why 'this' is used [2 marks]
7) Static veriable [3 ya 5 marks]
8) Unary and Binary Operators [3 ya 5 marks]
9) Advantages and Dis-advantages of templates [5 ya 10 marks]
10) Definition of Function overloading and Operator overloading [5 ya 10 marks]
11) Definition of memory leak [2 ya 3 marks]