Latest news: --- *!*~*!***~EID UL FITR MUBARAK TO CN AND ALL MUSLIMS*~*!*!*!* ---

fun  Cn Magazine Cn Software Facebook Google + Fb

[-]
Shout: -
Options
Loading...
Smilies
Popup Shoutbox

Post Reply 
 
Thread Rating:
  • 7 Vote(s) - 2.86 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS201 finalterm current paper 20-07-2013
07-21-2013, 06:07 PM
Post: #1
CS201 finalterm current paper 20-07-2013
CS201 Current Final Paper..........!!!
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)



[Image: attachment.php?aid=2782]

[Image: 28mes3.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to YASIR AWAN for this post:
• ÎŽЇ ŘαO • (07-26-2013)
07-21-2013, 06:09 PM
Post: #2
RE: CS201 finalterm current paper 20-07-2013
CS201 Current Final Paper 2013
40 mcqs
subjective two questions 2,2 marks
3 questions 3,3 marks program coding
3 questions 5,5 marks
2 program class sa and 2 program matrix sa 5 marks waly
only one question of two marks is without program and coding
and midd sa kuch nae aaya

[Image: attachment.php?aid=2782]

[Image: 28mes3.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to YASIR AWAN for this post:
• ÎŽЇ ŘαO • (07-26-2013)
07-21-2013, 06:09 PM
Post: #3
RE: CS201 finalterm current paper 20-07-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;

return number; Answer:
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;

[Image: attachment.php?aid=2782]

[Image: 28mes3.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to YASIR AWAN for this post:
• ÎŽЇ ŘαO • (07-26-2013)
07-21-2013, 06:10 PM
Post: #4
RE: CS201 finalterm current paper 20-07-2013
mcq's 40
subjective 12
Mcq's were mostlly related to classess, templates, operator overloading and functions.
1.Suppose an object has a pointer type as data member. (5 marks)
a) What happen when we assign that object to nother object using default assignment operator?
b)What hppens if we delete one object in the above situation?
2. Write a progrm whhich will open a file named "this.txt" and then using write() function, writes the string "Introduction to programming" (5)
3. class matrix (5 marks)
{
private:
int Elements [3][3];
};
Write the operator function of insertion to this clss.
4. what happens when e use new and delete operators>? (2 marks)
bus ye yad hy!

[Image: attachment.php?aid=2782]

[Image: 28mes3.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to YASIR AWAN for this post:
• ÎŽЇ ŘαO • (07-26-2013)
07-21-2013, 06:10 PM
Post: #5
RE: CS201 finalterm current paper 20-07-2013
CS201 Current Final Paper..........!!!

Long Question

Q1: Given is the code for a class named Coordinate.(10)

class Coordinate
{

private:

int X, Y;

public:

Coordinate()
{
X = 0;
Y = 0;
}



class Coordinate
{
friend void Displaycord();
private:

int X, Y;

public:

Coordinate()
{
X = 0;
Y = 0;
}

};





Q2: Write a program that defines a Template function named Square () which finds the square of a number and then return it. Define one variable of type int in main function and then call Square function on that. (10)

Program output should look like this:

Enter an integer value to find its Square: 6
Square of integer number is: 36

Q3: Why is it necessary to initialize a static object as the time of creation and how it is initialized ?(5)


Q4:Transform the following If-else statement into switch statement.(5)

if (x == 5)
...
else if (x == 10 || x == 11)
...
else if (x == 8)
...
else if (x == 9)
...
else
...



Q5:Read the given code and explain code functionality. (3)


Matrix :: Matrix ( const Matrix & m )
{
numRows = m.numRows ;
numCols = m.numCols ;
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 ] = m.elements [ i ] [ j ] ;
}
}

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

Q6: In the following code;(3)

#include <iostream.h>
#include <conio.h>
main() {

double j;

getche();

}

Is double j; an example of global variable or local variable ? Why ?


Q7: Identify and correct the error in the given code segment.(3)
main()
{
int val = 30;
int &ref = val;

&ref = &ref++;

}

Q8: Determine the output of the given program code.(2)

for (int I = 1; i<5; i++){
if ( I == 3)
continue;
cout I endl ;
}

Q9: What is the output of following code snippet.(2)

// class templates
#include <iostream>
using namespace std;

template <class T>
class mypair {
T a, b;
public:
mypair (T first, T second)
{a=first; b=second;}
T getmax ();
};

template <class T>
T mypair<T>::getmax ()
{
T retval;
retval = a>b? a : b;
return retval;
}
int main () {
mypair <int> myobject (100, 75);
cout myobject.getmax();
system("pause");
}


Q10: How can we declare and initialize static data member of a class?(2)

Q11: When memory is allocated dynamically using new operator within the constructor of class then what is an appropriate place to de-allocate the memory?(2)

Q11: Write down the output of the following code segment? (2)

int x[10] = {0,1, 2, 3, 4, 5, 6, 7, 8, 9};
int *xptr;
xptr = &x[5];
cout *(xptr++) + 1;

MCQ
Sequence of event(s) when allocating memory using new operator is ____________.

Assignment operator is ________ associative

To avoid dangling reference, always return _________.
Which value is returned by the destructor of a class?
The functions used for dynamic memory allocation return pointer of type ______.
The function free() returns back the allocated memory got through calloc and malloc to _____ .
At the time of linking, library functions are available in the ________form.
Which of the following is NOT a preprocessor directive?
When we define an array of objects then ___________.
A constructor will create a new object with a full copy of the other object, this type of copy is known as ___________.
When an object of a class is defined inside another class then ______________.
Every stream has _________.
_________in the following options is not a method of output stream.
To perform manipulation with input/output, we have to include ________ header file
A class whose object is contained as const object, must have ____________.
By using objects as class members, _________ is achieved
The operator function will be implemented as _____, if both objects (obj1, obj2) are passed as arguments to - operator in the statement given below.
obj3 = obj1 - obj2;

ANSI stands for _________.
A template function must have at least _______________ generic data type.

Which of the following is true about operator overloading?
1-The operator works with only objects of the class in which it is overloaded.
2-The operator works with objects and primitive data types regardless of parameters.
3-The operator works with both objects and primitive data types depending on parameters.
4-The operator must have a constant and an object as parameters.
Operator overloading can be performed through__________________.
The pointer returned by the new operator points to ___________ of memory chunks allocated by the new operator.

The return type of the operator function for operator is __________.

What will be the output of following statement?

cout setfill(‘0’) setw(7) 128 ;

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



Consider the following code segment.

struct intorDouble
{
Int ival;
Double charvar;
};

main()
{
intorDouble VAZ;
int size ;
size = sizeof(VAZ);
}

What will be the value of variable size if integer occupies 4 bytes and double occupies 8 bytes?

The file-open mode __________ is used to open a file for output and move to the end of the file.

In the statement int &x = y; compiler ______.
Which header file must be included to use the functions tolower() and toupper()?
Which one of the following functions is included in stdlib.h header file?
For one byte, there are _____ combinations of values which can be stored in computer.
Which of the following statement is best regarding declaration of friend function?
Answer- It can be declared anywhere in class as these are not affected by the public and private keywords.
The operator used for dereferencing the elements of an array using a pointer is _________.
The __________ statement forces the immediate next iteration of the loop.
A function is a block of statements (code) that can be __________.
Which of the following values are used in C/C++ to represent true and false?
Ans- 1 and 0
The dynamic memory allocation uses memory from the ____________.
In C/C++, null character is represented as ________________.

Another paper

what is stack un winding?

what is templet?

what is relation ship between person and teacher?? diagaram thi?

what is iterator?

what is types of iterator?

long Question horse is a good pet animal describe by oop that about horse?

give C++ code to simplyfiy that oop is case senstive

(please friends dua lazmi karna mery liay mera paper normal howa hai so ap ki dua ki b zaroort hai)

give c++ code and define a templete fuction

c++ code that eror corect karna tha .....templete ka tha??

eror handling ki type this??

aur mcqs half past say half new thay...

[Image: attachment.php?aid=2782]

[Image: 28mes3.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to YASIR AWAN for this post:
• ÎŽЇ ŘαO • (07-26-2013)
07-21-2013, 06:11 PM
Post: #6
RE: CS201 finalterm current paper 20-07-2013
My CS201 Current Paper
40 mcqs …..only 20% were from past papers:
Subjective Qs were almost 90% from past papers … Some Qs which I remember
1) What happens when we use new and delete operator? (from past papers)
2) Question: 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(from past papers)
3) 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: (from past papers)
xxxxxx1000
xxxxxx1500
xxxxx20000
xxxxx30000
xxxxx60000
4)Overflow condition is used in repetition structure at which point it oocurs?
5)Is it possible to overlad operation for primitive data types.justify yor ans
6) Let we have a class,
class String
{
private: char buf[25];
}; Write code for assignment (=) operator function which assign one String object to other object. Your code should also avoid self assignment(from past paper)
7)What happen when an object is assigned to another object without overloading an assignment operator?
8)Write function name sum which accepts an integer as a argument in the function use a static variable to add the value passed to it as argument with each function call is the endl display the sum of value pass an argument:
9) Question Nai 40 ( Marks: 10 ) Write a program which consists of two classes, Date and Person. Date class should contain three data members day , month , year and setter and getter function for these data members. Date class should also contain showdate() member function to display date.
Person class should contain three data members Name, Address, and Bday , where Name and Address are char pointer while Bday(Date of birth) is of type Date, Person class should further contain two member functions Display() and setdate().
In main program Create an object of Class person and call the member functions with it..(from Past Papers.

[Image: attachment.php?aid=2782]

[Image: 28mes3.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to YASIR AWAN for this post:
• ÎŽЇ ŘαO • (07-26-2013)
07-21-2013, 06:12 PM
Post: #7
RE: CS201 finalterm current paper 20-07-2013
CS201 Current Final Paper

Q1: (Marks 5) Write a program that defines a Template function named Add () which adds two numbers returns Sum. Define two variables of int type in the main and then call Add () function on that.
Output should be like this:

Adding numbers (don’t remember here what was written)
Enter first number:
12
Enter second number:
25
Sum=37

Q2: (Marks 5) Find the error in the program and then remove this. (Don’t remember the coding)

Q3: (Marks 5) Given the class Data

main()
{
class Date
{
private:
int day, month, year;
public:
day=01;
month=10;
year=2010
}
……………..Dont remember the lines
……………..
……………..

}

Use the dynamically allocation (don’t remember what)
In the last also free memory allocation.

Q4: (Marks 3) Why goto is not recommended to use in programmes?
Q5: (Marks 2) Write two types of data conversions used for used defined data types.
Q6: (Marks 2) Write the following using logical operators:
1. number is both multiple of 4 and 6
2. number is even but not 8
3. answer is either N or n
4. don’t remember this

Q7: (Marks 3) Write the output of the following if “int 5” is passed to the variable:
Template <class T);
T reciprocal (T x);
{
return (1/x);
}
(it was like something. Don’t remember exactly)

Q8: (Marks 3): How can we determine that dynamically memory allocation has been set successfully or not is C++ using the new operator?

[Image: attachment.php?aid=2782]

[Image: 28mes3.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to YASIR AWAN for this post:
• ÎŽЇ ŘαO • (07-26-2013)
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)