Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS201 Final term 2011 July current paper
#1
Question No: 1 ( Marks: 1 ) - Please choose one

&& is -------------------- operator.

► An arithmetic

► Logical

► Relational

► Unary



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

Which of the following function(s) is/are included in ctype.h header file?

► isdigit(int c)

► isxdigit(int c )

► tolower(int c)

► All of the above



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

Disks are _______________ devices having access time of _________ milliseconds.vuZs

► Electro-physical, 6

► Electro-Mechanical, 4

► Electro-physical, 5

► Electro-Mechanical, 7



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

All preprocessor directives are started with the symbol______.

► *

► +
► @

► #



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

When we use manipulators in our program then which header file should be included?

► iostream.h

► stdlib.h

► stdio.h

► iomanip.h



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

setprecision is a parameter less manipulator.

► True

► False

vuZs

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

Which of the following is NOT a preprocessor directive?

► #error

► #define

► #line

► #ndefine



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

We can do arithmetic with references like pointers.

► True

► False



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

What does (*this) represents?

► The current function of the class

► The current pointer of the class

► The current object of the class

► A value of the data member



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

Friend function of a class is ______________ .

► Member function

► Non-member function

► Private function

► Public function

vuZs

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

A function can declare itself a friend of a class.

► True

► False



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

Overloaded delete operator function takes the same parameter as an argument returned by new operator function.

► True

► False



Question No: 13 ( 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

vuZs

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

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

► Zero

► One

► Two

► Three



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

A template function must have only generic data types.

► True

► False



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

We can not make a member function of a class as template function.

► True

► False

vuZs

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

Which character is inserted at the end of string to indicate the end of string?

► new line

► tab

► null

► carriage return



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

Assignment operator is used for ___________.

► calculation

► reading

► assigning value to variables

► None of the given options.



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

The object _______________may be used both for file input and file output

► fstream,

► ifstream,

► ofstream,

► none of the given options.

vuZs

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

Which of the following function calling mechanism is true for the function prototype given below?

float func(float &);

► Call by value

► Call by reference using pointer

► Call by reference using reference variable

► None of the given options



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


vuZs

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

Overloaded delete operator function takes parameter of void pointer and returns ________.

► void

► void pointer

► pointer to an object

► pointer of type int



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

What should be the return type of the constructor?

► void pointer

► int

► same as object type

► constructors do not return any thing



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

It is a way of reusing the code when we contain objects of our already written classes into a new class,

► True

► False



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

Templates are not type safe.

► true

► false



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

The functions used for dynamic memory allocation return pointer of type ______



► int

► float

► void

► double



Question No: 27 ( Marks: 2 )

Write a declaration statement for an array of 10 elements of type float. Include an initialization statement of the first four elements to 1.0, 2.0, 3.0 and 4.0.

Answer:

float floatArry[10] = {1.0,2.0,3.0,4.0};

Question No: 28 ( Marks: 2 )

Write the general syntax for the declaration of pre-increment and post-increment member operator function.

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

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

Question No: 29 ( Marks: 2 )

What is difference between endl and \n?

Endl is manipulator and it insert new line character and flush the stream.

\n is control charcter which is used to insert linebreak

Question No: 30 ( Marks: 2 )

What does code optimization mean?

It is process by which we make over code such a way that it improves the speed of program. By use of optimization we refine program codes in such a way that it run faster and consume less memory. We do it in such a way that output quality is not compromised

Question No: 31 ( Marks: 3 )

How is the following cout statement interpreted by compiler?

cout << a << b << c ;

It will give a compiler error because a,b,c are not declared.

Question No: 32 ( Marks: 3 )

Suppose an object of class A is declared as data member of class B.

(i) The constructor of which class will be called first? Answer : A

(ii) The destructor of which class will be called first? Answer : B

Question No: 33 ( Marks: 3 )

Define static variable. Also explain life time of static variable?

Question No: 34 ( Marks: 5 )

What is difference between Unary and binary operators and how they can be overloaded?

Opertaror is keyword

Question No: 35 ( Marks: 5 )

What steps we must follow to design good program?



Question No: 36 ( Marks: 5 )

Write a program which defines five variables which store the salaries of five employees, using setw and setfill manipulators to display all these salaries in a column.

Note: Display all data with in a particular width and the empty space should be filled with character x

Output should be displayed as given below:

xxxxxx1000

xxxxxx1500

xxxxx20000

xxxxx30000

xxxxx60000

Answer:

#include <iostream.h>

#include <iomanip.h>

main(){

int sal1 =1000;

int sal2 =1500;

int sal3 =20000;

int sal4 =30000;

int sal5 =60000;





cout << setfill ('x') << setw (10);

cout<< sal1<<endl;

cout << setfill ('x') << setw (10);

cout<< sal2<<endl;

cout << setfill ('x') << setw (10);

cout<< sal3<<endl;

cout << setfill ('x') << setw (10);

cout<< sal4<<endl;

cout << setfill ('x') << setw (10);

cout<< sal5<<endl;

int i=0;

cin>>i; // to stop the screen to show the output

}

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  MGT401 Financial Accounting II Spring 2014 Current and Past Mid Term Papers Vuhelper 0 2,511 12-25-2014, 03:36 PM
Last Post: Vuhelper
  MCM301 Communication skills Spring 2014 Current and Past Mid Term Papers Vuhelper 0 3,166 12-25-2014, 03:24 PM
Last Post: Vuhelper
  CS101 - Paper 1 (Solved) Mid Term & Final Term Papers 2014-2015 Examination Vuhelper 0 3,053 12-16-2014, 02:52 PM
Last Post: Vuhelper
  ENG301 Business Communication Solve Final term Paper Fall 2013 Vuhelper 1 6,268 08-18-2014, 12:11 PM
Last Post: husnain99
  MGT101 Financial Accounting Spring 2014 Past Final Papers August 2014 education-2014 0 2,466 08-11-2014, 05:51 PM
Last Post: education-2014
  Check Online CS607 Artificial Intelligence Current and Past Final Term Papers 2013 Vuhelper 0 1,770 08-04-2014, 03:15 PM
Last Post: Vuhelper
  ENG001 Elementary English Fall 2013 Current and Past Final Term Papers vuassignments 0 3,214 07-26-2014, 05:15 PM
Last Post: vuassignments
  new latest Islamiyat css paper for 2014-15 Entboy 1 4,026 07-22-2014, 06:47 PM
Last Post: Entboy
  solve past paper of mcm 301 (communication skills) requird Arva Afrenish 14 13,094 02-23-2014, 01:09 PM
Last Post: farhan.sakhi
  CS410 Visual Programming Solved Mid Term Papers Mega File Fall 2012 Vuhelper 1 4,559 12-16-2013, 07:15 PM
Last Post: vu student

Forum Jump:


Users browsing this thread: 1 Guest(s)