www.vustudents.ning.com

# Please Share your Current Final Paper of CS201 Introduction to Programming Spring 2013 (20 Jul 2013 TO 31 Jul 2013)

Final Paper of CS201

Introduction to Programming

Spring 2013

(20 Jul 2013 TO 31 Jul 2013)

<   CS201 Current Final Papers >>>

Question 1:

Identify each of the following as system software and application  software.

LINUX, DISK CLEANUP, WORD PROCESSOR, WINDOWS, STUDENT  INFORMATION (mark 5)

Q2:

Write the explanation of this program. See program from book pg no534.  (mark5)

Q3: Write a program which defines three variables of type double which  store three different values including decimal points, using set precision

manipulators to print all these values with different numbers of digits  after the decimal number.(5)

Q4 define static variable also explain life time of static variable? (3)

Q5 what do you know about run time error? (3)

Q6 what are limitation of the friendship between classes? (3)

Q7: read the code and explain the functionality of this program? See  page 535 for cod (3)

Q8: write down the meanings of given below line of code, where m is an  object of the class matrix. If (& m = this) (2)

Q9: write the general syntax for the definition of the user defined  function? (2)

Q10: what is the source and destination of cin?(2)

Q11: write the general syntax of allocation memory dynamically to an  array using new operator? (2)

1.what is diffrent between pointer and variable?

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

3.how many types of templates?

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

template T reciprocal(T x) {return (1/x); }

5. Identify the errors in the following member operator function and also  correct them.

math * operator(math m);  math * operator (math m)

{

math temp;

temp.number= number * number;

The errors are in the arguments of the member operation function and  also in the body of operator member function.

Correct function should be  math *operator(math *m);

math *operator (math *m)  {

math temp;  temp = m;

temp.number= number * number;  return temp.number;

Q# 6 what are limitation of the friendship between classes? (marks3)  Q# 7 Read the code and explain the functionality of this program? See page  535

for cod (marks3]

Q# 8 write down the meanings of given below line of code, where m is an  object of

the class matrix. If (& m = this) (marks 2)  Q# 9

write the general syntax for the definition of the user defined function?  (marks2)

Q# 10

what is the source and destination of cin?(marks2  Q# 11

write the general syntax of allocation memory dynamically to an array  using new

operator? (marks2)

Q3: Write a program which defines three variables of type double which  store three

different values including decimal points, using set precision  manipulators to print all

these values with different numbers of digits after the decimal  number.(5)

Q4 define static variable also explain life time of static variable? (3)  Q5 what do you know about run time error? (3)

Q6 what are limitation of the friendship between classes? (3)

Q7: read the code and explain the functionality of this program? See  page 535 for cod (3)

Q8: write down the meanings of given below line of code, where m is an  object of the

class matrix. If (& m = this) (2)

Q9: write the general syntax for the definition of the user defined  function? (2)

Q10: what is the source and destination of cin?(2)

Q11: write the general syntax of allocation memory dynamically to an  array using new

operator? (2)

Q: define buffer?explain its usage? 5 MARKS

Q: why binary search algorithm is efficient than linear search algorithm?

5 marks

Q: perator function ka syntex(3 marks)

Q: post increment and pre increment k syntex btana thay(2 marks)

Q:what is language translator?(2 marks)

Q: write somethiing something about testing in designing program? 3  MARKS

Q:Read the given below code and explain what task is being performed by  this function 5 MARKS

Matrix :: Matrix ( int row , int col )   {

numRows = row ;  numCols = col ;

elements = new ( double * ) [ numRows ] ;  for ( int i = 0 ; i < numRows ; i ++ )

{

elements [ i ] = new double [ numCols ] ;

for ( int j = 0 ; j < numCols ; j ++ )  elements [ i ] [ j ] = 0.0 ;

}  }

Hint : This function belong to a matrix class, having   Number of Rows = numRows

Number of Columns = numCols

Which one (copy constructor or assignment operator) will be  called in each of the following code segment?

1) Matrix m1 (m2);  2) Matrix m1, m2;

m1 = m2;

3) Matrix m1 = m2;

Views: 1467

### Replies to This Discussion

Paper 21,July 2013—CS201

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

In flow chart, the symbol use for data flow……..,

Rectangle

Circle

Arrow

Diamond

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

x *= y+z

►x = x * (y+z)

►x = x*y+z

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

Which looping process is best, when the number of iterations is known?

for

while

do-while

all looping processes require that the iterations be known

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

Declaration of short int with name of sum.

►int short sum;

►short int sum;

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

The stream objects cin and cout are included in which header file?

► iostream.h (Page 15)

fstream.h

istream.h

ostream.h

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

Dereferencing operator is represented by _______

*
+

None of the given

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

If a class A declares itself a friend of class B and a class B declares itself a friend of class C then __________.

Class A is also a friend of class C.

►Class B is also a friend of class A.

Class A is also a friend of class C if A declares C as its friend

Class A is also a friend of class C if C declares A as its friend.

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

In functions that return reference, use __________variables.

Local

Global

► Global or static (Page 369)

None of the given option

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

Class is a user defined___________.

► data type (Page 317)

► memory referee

► value

► none of the given options.

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

Function seekg() takes ____________ parameter(s).

0

► 1

2

3

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

The operator used for casting, in C, is standard ________ operator.

none of the given options.

► cast (Page 281)

cost

const

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

The first parameter of operator function for operator,

Must be passed by value

► Must be passed by reference (Page 446)

Can be passed by value or reference

Must be object of class

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

The second parameter of operator function for >> operator,

Must be passed by value (Page 446)

► Must be passed by reference (Page 446)

Can be passed by value or reference

Must be object of class

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

A Pointer is a special variable that contain

► Data values

► Both data and values

► None of the given option

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

Classes

► Function (Page 371)

Operators

Reference

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

►The operator works with only objects of the class in which it is overloaded.

The operator works with objects and primitive data types regardless of parameters.

The operator works with both objects and primitive data types depending on parameters.

The operator must have a constant and an object as parameters.

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

The operator function overloaded for an Assignment operator (=) must be

Non-member function of class

► Member function of class (Page 372)

Friend function of class

None of the given options

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

With template function, the compiler automatically detects the ___________ and generates ______________ using passed data

►passed data , a new copy of function

parameters, an old copy of function

old copy of function, parameters

parameters, an new copy of function

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

What does STL stand for?

Source template library

► Standard template library (Page 519)

Stream template library

Standard temporary library

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

Templates provide way of abstracting ______________ information.

►Type

Data

Method

Access

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

The code is written to __________ the program.

► implement (Page 520)

design

analysis

none of the given options.

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

The appropriate data type to store the number of rows and colums of the matrix is____________.

float

► int

char

none of the given options.

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

ANSI

► American Neutral Standards Institute

Asian National Standards Institute

►American National Standard Institute

Australian National Standards Institute

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

Which of the following option will be true, if we overload "-=" operator?

only - operator needs to be overloaded

Minus (-) and = operators need to be overloaded

► the -= operator need to be overloaded explicitly

the - and = operators need to be overloaded implicitly

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

Classes defined inside other classes are called ________ classes

looped

► nested (Page 492)

none of the given options.

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

When an object calls a member function, the function implicitly gets a this ______.

►Operator

Function

Pointer

Object

Question No: 32 ( 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 (Page 496)

► Constructor of inner object will be called first

Constructor and Destructor will be called simultaneously

None of the given options

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

Which of the following is NOT a preprocessor directive?

#error

#define

#line

► #ndefine (Page 272)

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

Which of the following is NOT a common error that can happen with memory a  llocation?

Memory leak

Unreferenced memory

►Void pointers

Dangling pointers

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

Which of the following function is used to increase the size of already allocated memory chunk?

malloc

calloc

► realloc (Page 285)

free

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

NULL value has been defined in ______ and _________ header files.

strings.h and iostream.h

ctype.h and conio.c

conio.c and conio.h

► stdlib.h and stddef.h (Page 281)

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

Which value is returned by the destructor of a class?

A pointer to the class.

An object of the class.

A status code determining whether the class was destructed correctly

► Destructors do not return a value. (page 323)

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

Which one is the correct syntax for defining an identifier PI with preprocessor directive?

#define PI 3.1415926;

#define PI 3.1415926

#define PI = 3.1415926 ;

#define PI = 3.1415926

jiska paper ho gya hai cs201 ka . plz koi btay k old paper mese aya tha ya nhe ?

r  moaz file me sie kitne percetn aya tha paper plzzzzzzzzzzzzzzzzzzzzzz

Zeshan Ali gud keep it up & thanks for sharing

Attention Related Final Term papers Spring 2013: All Fellows You don’t need to go at any other site for current Final Term papers Spring  2013, Because All discussed data/sharing of our members in this discussion are going from here to other sites. (Other sites Admins/mods Copy from here & posted at their sites with fake IDs or original name: p). you can judge this at other sites yourself. So don’t waste your precious time with different links.

My Today CS201 FINAL PAPER (22-7-2013)

Total Questions: 52

40 MCQ’S : 40 Marks                        4 Questions: 2 Marks

4 Questions: 3 Marks                          4 Questions: 5 Marks

(5-7)MCQ’s are from Moaz objective file

Some MCQ’S are:

• Result of mathematical operation 6+27/3*3 is:

45               9                 33                30

• Result of the expression z=x%y if x=19 and y=4?

2                 3                 4                 5

• A precise sequence of steps to solve a problem is:

Program                Utility          Routine                 Statement

• The member function of the class occupy ______ region in memory for ________ objects of class.

Separate, each                 Common, all                   Different, each                 Different, all

• Automatic variable are created on __________

Heap           Free store              Static storage                  Stack

• Templates provide way of abstracting ____ information.

Type                     Data            Method                 Access

• The code is written to _______ a program.

Implement             Design                   Analysis                Test

• ANSI stands for____________
• STL stands for _______________

• At the time of linking, library functions are available in the__________ form.

Compiled              Text             Run able                Code

• Assignment operator is __________ associated.

Left             Right           Binary                   Unary

Subjective:

2 MARKS:

• What is return by new operator?

• What is the equivalent C expression for following algebraic expression?

ax3ay2 + bax2y + abcx

• Write down piece of code that will declare a matrix of 3x3. And initialize all its locations with 0;

int matrix [3] [3] ;

matrix [0] [0] = 0;

matrix [0] [1] = 0;

matrix [0] [2] = 0;

matrix [1] [0] = 0;

matrix [1] [2] = 0;

matrix [1] [2] = 0;

matrix [2] [0] = 0;

matrix [2] [1] = 0;

matrix [2] [2] = 0;

we can also do it as given below

int matrix [3][3] = { 0 }; //all elements 0

• How can we initialize an object which is declared as constant data member in another class?

3 MARKS:

• Write the output of the given code:

#include<iostream.h>

Main()

{

int num [3][2]={12,51,34,54,12,55}

for (int j=0; j<3; j++)

cout*(*(num+j)+1)endl;

return 0;

}

• Write simple program that use getline() of cin obj for reading string of 30 char from keyboard when press enter to output;
• Describe each in one line:

Matrix (int =0, int=0);

Matrix (const Matrix&);

≈Matrix();

• Given is the code for nested classes:

Class First

{

Public:

class Second

{

Public:

Second()

{

fValue=20;

}

Void Display();

Private:

Int fValue;

};

};

Write these code to define Display() member function of class outside the body of outer class. The function Display() will display the value of data member fValue of class First.

5MARKS:

• Suppose you want to develop a payroll system of a company having permanent, contract and hourly based employees. Which type of activities would you follow to program this system efficiently?

• Write the main function in which you have to add three integer elements in template class queue, and then call print function. After that, remove two elements from the queue.

Iss ke baad ik lengthy program or code likha hoa tha due to shortage of time I can’t wrote it.

• Template class queue

Class Weight()

{

Private:

int Kilograms, grams;

Public:

Weight()

{

Kilograms=0;

Grams=0;

}

Weight (int k, int g)

{

Kilograms=k;

Grams=g;

}

};

You are required to write the > operator overloading function for comparing the objects of type weight such that if first weight object is greater than second, the function must return true otherwise it should return false.

• Write a program which defines three variables of type double which store three different values including decimal points, using set precision manipulators to print all these values with different numbers of digits after the decimal number.(5)

#include

#include

int main ()

{

double x1 = 12345624.72345

double x2 = 987654.12345

double x3 = 1985.23456

cout setprecision (3) x1 endl;

cout setprecision (4) x2 endl;

cout setprecision (5) x3 endl;

return 0;

}

upper diye gaye mcqs ko solve kardo koi plzzzz

Check this out frndz!!!

Attachments:

jiska paper ho gya hai cs201 ka . plz koi btay k old paper mese aya tha ya nhe ?

r moaz file me sie kitne percetn aya tha paper plzzzzzzzzzzzzzzzzzzzzzz

CS201 final term paper

1- Write statement for constant pointer to integer and also pointer to constant integer.
2- Get input from user for 2 by 4 matrix and display it.
3- For given code of class rectangle, write code for copying constructor.
4- How will you identify if a declared variable if reference of address variable.
Some other questions were,
For given code having new operator, write delete.
For given code for converting Celsius to Fahrenheit, write equivalent template.

Q1: What are two types of conversion for user-define datatype?
Q2: What will be the output of temple if pass value 5 of integer type
template < class T>
T reciprocal (T x ) {
return 1 / x;
}
Q2: If a structure is passed to function what will default calling conversion (by value or by reference)
Q3: Write program to print floatg point 1.234 in a 9 digit with precidiog zero
Q4: What is out put of the program
Char msg[10] = “Yaqoob”;
strncat(msg,name,3);

Q5 : write simple program that use getline() of cin obj for reading string of 30 char from keyboard when press enter to output;
Q7 : output of the program
int n = -77;
cou.width(6);
cout right n endl;
cout.width(6);
cout left n endl;

Q6 : use templeate function square and find the number then return define variable type double in main function…
Q8: conweight into pound forumul give using function solve quesioin
Q9: write program that declar 5 int and display the output following
xxxxxx1000
etc
mcqs
in _______ first pointer store the address of the some other pointer which contain the address of any variable
when call to fuction statement is encountered ____________
to avoid dangling pointer always return ________________

Q1: What are two types of conversion for user-define datatype?
Q2: What will be the output of temple if pass value 5 of integer type
template < class T>
T reciprocal (T x ) {
return 1 / x;
}
Q2: If a structure is passed to function what will default calling conversion (by value or by reference)
Q3: Write program to print floatg point 1.234 in a 9 digit with precidiog zero
Q4: What is out put of the program
Char msg[10] = “Yaqoob”;
strncat(msg,name,3);

Q5 : write simple program that use getline() of cin obj for reading string of 30 char from keyboard when press enter to output;
Q7 : output of the program
int n = -77;
cou.width(6);
cout right n endl;
cout.width(6);
cout left n endl;

Q6 : use templeate function square and find the number then return define variable type double in main function…
Q8: conweight into pound forumul give using function solve quesioin
Q9: write program that declar 5 int and display the output following
xxxxxx1000
etc
mcqs
in _______ first pointer store the address of the some other pointer which contain the address of any variable
when call to fuction statement is encountered ____________
to avoid dangling pointer always return ________________

M
A
Ring
Y
U
M

1

2

3

4

5

## Latest Activity

khalid Jamshed joined + M.Tariq Malik's group

### PSY632 Theory & Practice of Counseling

28 minutes ago
khalid Jamshed joined + M.Tariq Malik's group

### PSY405 Personality Psychology

35 minutes ago
khalid Jamshed joined + M.Tariq Malik's group

### PSY403 Social Psychology

58 minutes ago
╋╋Z@¥¥@N RaJPuT╋╋ liked ++❤MQ++A❤❤❤'s discussion Mard jbh
1 hour ago
╋╋Z@¥¥@N RaJPuT╋╋ liked + ! ! ! ! ﾑ爪 ♡♡'s discussion ѕιяf тυм нσ♥️
1 hour ago
1 hour ago
╋╋Z@¥¥@N RaJPuT╋╋ updated their profile
1 hour ago
+ !! Ή@ᵯᵯℹ Ⲥℋ!! +!! liked ++❤MQ++A❤❤❤'s discussion Mard jbh
8 hours ago