free geoip

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS201- Introduction to Programming
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
FINALTERM EXAMINATION

Fall 2009

CS201- Introduction to Programming


Question No: 1 ( Marks: 1 ) - Please choose one


In C/C++ if we define an array of size eight (8) i.e. int Arr [8]; then the last element of this array will be stored at,

► Arr[0]

► Arr[8]

► Arr[7]

► Arr[-1]

Question No: 2 ( Marks: 1 ) - Please choose one

When an array is passed to a function then default way of passing this array is,

► By data

► By reference

► By value

► By data type


Question No: 3 ( Marks: 1 ) - Please choose one


Array is a data structure which store

► Memory addresses

► Variables

► Data Type

► Data


Question No: 4 ( Marks: 1 ) - Please choose one


We can also create an array of user define data type.


► True

► False

Question No: 5 ( Marks: 1 ) - Please choose one


When we define an array of objects then,


► Destructor will call once for whole array


► Destructor will call for each object of the array


► Destructor will never call


► Depends on the size of array


Question No: 6 ( Marks: 1 ) - Please choose one


What is the sequence of event(s) when allocating memory using new operator?

► Only block of memory is allocated for objects


► Only constructor is called for objects


► Memory is allocated first before calling constructor


► Constructor is called first before allocating memory


Question No: 7 ( Marks: 1 ) - Please choose one


We can delete an array of objects without specifying [] brackets if a class is not doing dynamic memory allocation internally.


► True

► False

Question No: 8 ( Marks: 1 ) - Please choose one


The second parameter of operator functions for << and >> are objects of the class for which we are overloading these operators.



► True

► False

Question No: 9 ( Marks: 1 ) - Please choose one

Which of the following is correct way to initialize a variable x of int type with value 10?


► int x ; x = 10 ;

► int x = 10 ;

► int x, x = 10;

► x = 10 ;

Question No: 10 ( Marks: 1 ) - Please choose one

Default mechanism of function calling in case of array is _____ and in case of variable is ___.

► Call by value, call by reference


► Call by referene, call by reference


► Call by reference, call by value


► Call by value, call by value

Question No: 11 ( Marks: 1 ) - Please choose one

What does STL stand for?



► Source template library


► Standard template library


► Stream template library


► Standard temporary library

Question No: 12 ( Marks: 1 ) - Please choose one

Skill(s) that is/are needed by programmers _______________________.

► Paying attention to detail

► Think about the reusability

► Think about user interface

► All of the given options

Question No: 13 ( Marks: 1 ) - Please choose one

For which array, the size of the array should be one more than the number of elements in an array?


► int

► double

► float

► char

Question No: 14 ( Marks: 1 ) - Please choose one
new and delete are _____ whereas malloc and free are _____.

► Functions, operators

► Classes, operators

► Operators, functions

►perators, classes

Question No: 15 ( Marks: 1 ) - Please choose one

Friend functions are _____ of a class.

► Member functions

► Public member functions

► Private member functions

► Non-member functions

Question No: 16 ( Marks: 1 ) - Please choose one
he prototype of friend functions must be written ____ the class and its definition must be written ____

► inside, inside the class

► inside, outside the class

► outside, inside the class

► outside, outside the class

Question No: 17 ( Marks: 1 ) - Please choose one
If overloaded plus operator is implemented as non-member function then which of the following statement will be true for the statement given below? obj3 = obj1 + obj2 ;
► obj2 will be passed as an argument to + operator whereas obj2 will drive the + operator

► obj1 will drive the + operator whereas obj2 will be passed as an argument to + operator

► Both objects (obj1, obj2) will be passed as arguments to the + operator

► Any of the objects (obj1, obj2) can drive the + operator
Question No: 18 ( Marks: 1 ) - Please choose one
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) ;

Question No: 19 ( Marks: 1 ) - Please choose one
For cin, the source is normally a ________ and destination can be ______.

► File, native data type

► Disk, user-define type

► Keyboard, variable

► File, user-define type

Question No: 20 ( Marks: 1 ) - Please choose one
We can also do conditional compilation with preprocessor directives.

► True

► False
Question No: 21 ( Marks: 1 ) - Please choose one
The programs, in which we allocate static memory, run essentially on ________

► Heap

► System Cache

► None of the given options

► Stack

Question No: 22 ( Marks: 1 ) - Please choose one
The default value of a parameter can be provided inside the ________________

► function prototype

► function definition

► both function prototype or function definition

► none of the given options.
Question No: 23 ( Marks: 1 ) - Please choose one
While calling function, the arguments are assigned to the parameters from _____________.

► left to right.
► right to left

► no specific order is followed

► none of the given options.

Question No: 24 ( Marks: 1 ) - Please choose one
When an operator function is defined as member function for a binary Plus (+) operator then the number of argument it take is/are.
► Zero
► One
► Two
► N arguments
Question No: 25 ( Marks: 1 ) - Please choose one
With user-defined data type variables (Objects), self assignment can produce __________.
► Syntax error
► Logical error
► Link error
► Non of the given options
Question No: 26 ( Marks: 1 ) - Please choose one
Assignment operator is used to initialize a newly declared object from existing object.

► True

► False
Question No: 27 ( Marks: 1 ) - Please choose one
When an object of a class is defined inside an other class then,
► Constructor of enclosing class will be called first
► Cnstructor of inner object will be called first
► Constructor and Destructor will be called simultaneously
► None of the given options
Question No: 28 ( Marks: 1 ) - Please choose one
In the member initializer list, the data members are initialized,
► From left to right
► From right to left
► In the order in which they are defined within class
► None of the given options
Question No: 29 ( Marks: 1 ) - Please choose one
new operator allocates memory from free store and return _____________.
► A pointer

► A reference
► An integer
► A float
Question No: 30 ( Marks: 1 ) - Please choose one


"new" and "delete" keywords are _____________ in C++ language.


► Built-in- Function


► Operators


► Memory Allocation Function


► None of the given options






Question No: 31 ( Marks: 1 )


What is a constructor in class?

Ans:
Class constructor, is the method specific to a type as a whole that run after the type is loaded and before any of the type's members are accessed. Class constructors are used for static field initialization. Only one class constructor per type is permitted, and it cannot use the vararg (variable argument) calling convention. Normally, class constructors are never called from the IL code. If a type has a class constructor, this constructor is executed automatically after the type is loaded. However, a class constructor, like any other static method, can be called explicitly. As a result of such a call, the global fields of the type are reset to their initial values. Calling class constructor explicitly does not lead to type reloading.


Question No: 32 ( Marks: 1 )


What are the two types of conversion for user-defined data types?



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?

Ans:




Question No: 34 ( Marks: 2 )


Give the general syntax of class template.


Question No: 35 ( Marks: 3 )


What is the difference between structure and class?


Question No: 36 ( Marks: 3 )


How many arguments does binary member operator function and binary non-member operator function take?

Question No: 37 ( Marks: 3 )


Find the error in the given code
for ( int i=0; i<numRows; i++)
{
for(int j=0; j<numCols; j++)
{
elements[i , j] = m.elements[j];
}
}




Question No: 38 ( Marks: 5 )


Write the C++ syntax for making a class friend of other class.



Question No: 39 ( Marks: 5 )


What is a template function? Give the general syntax of writing a template function.


Question No: 40 ( Marks: 10 )

[JUSTIFY]Write a program which contains a class student. The class should contain two char pointer variables Name, and department. The class should further contain constructors, overload the stream insertion operator (<<) for this class.


In main function create two objects and display these objects.
Reply
#2
PLZ answer this post ....<!!>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS101 Introduction To Computing Solved Quiz Spring 2010 Guru 2 6,057 12-15-2014, 08:37 PM
Last Post: Vuhelper
  CS411 Visual Programming Quiz No. 4 Fall 2014 Last Date 20th February 2015 Vuhelper 0 3,456 12-04-2014, 09:17 PM
Last Post: Vuhelper
  CS201-Introduction to Programming Quiz No.3 Discussion and Solutions Fall 2014 vuassignments 0 1,747 07-04-2014, 02:15 AM
Last Post: vuassignments
  CS401 Computer Architecture and Assembly Language Programming Quiz No 2 Spring 2014 vuassignments 0 2,191 05-27-2014, 04:52 PM
Last Post: vuassignments
  CS609 - System Programming Quiz No. 01 Solutio Spring 2014 vuassignments 0 1,972 05-21-2014, 04:23 PM
Last Post: vuassignments
  CS201-Introduction to Programming Quiz No.1 Solutions Spring 2014 vuassignments 0 2,661 05-15-2014, 04:17 PM
Last Post: vuassignments
  CS101 Introduction to Computing Quiz No.2 Solution Spring Semester 2013 Vuhelper 0 3,842 05-20-2013, 10:15 PM
Last Post: Vuhelper
  CS609 System Programming Quiz No.1 Solution Spring Semester 2013 Vuhelper 0 1,872 05-08-2013, 04:51 PM
Last Post: Vuhelper
  CS201 Introduction to Programming Online Quiz No.4 Solution & Discussion Fall 2013 Vuhelper 0 2,323 02-08-2013, 05:08 PM
Last Post: Vuhelper
  CS304 Object Oriented Programming Quiz No.3 Solution Fall Semester 2013 Vuhelper 0 2,629 02-04-2013, 05:01 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support