Collected and Composed by Bilal Farooq ([email protected])
Come and join us at WebLyceum
For Past Papers, Quiz, Assignments, GDBs, Video Lectures etc
and click Register http://www.weblyceum.como to G
In Case of any Problem Contact Administrators
)[email protected] Muhammad Safdar (
)[email protected] Farooq (
Come and join us at VU Social
For Non-Study Material Sharing, Chatting, etc,
and click Register http://www.vusocial.comGo to
(Weblyceum is not responsible for any solved content)
Collected and Composed by Bilal Farooq ([email protected])
CS201 Fall 2010 Paper # 01 2 Question of 1 marks
Both were about stream insertion << n stream extraction >> operator
2 questions of 3 marks
1st : what is meant by default constructor
2nd : what is conversion constructor
2 questions of 5 marks
1st: Y we keep utility functions as private in class?
2nd: Write a program using get() function of cin n puts function of cout n
take 30 array characters from keyboard n display on screen using these
functions?
2 question of 10 marks
1st: write a program define a line (-) operator n manipulate it
For example the output of program should be
Virtual--------university
2nd: write a program to overload a unary operator(++)n make a date class.
Day, year, month n lastday(last day of month) should be its data members,
operator as a function member,n display function to display date.
Now increment the day by using operator function n month should also b
incremented after 30 or 31 days,n year should also incremented after the 12
month
CS201 Fall 2010 Paper # 02
Question:
What is self assignment mean, why should it be avoided? [3 marks]
Collected and Composed by Bilal Farooq ([email protected])
Question:
Is it possible to overload operators for primitive data type? Justify [3 marks]
Question:
What are the limitations of the friendship relations between classes? [3
marks]
Question:
C and C++ are free format languages. What does mean by free format? [2
marks]
Question:
What are the two types of conversions for user defined data type? [1 marks]
Question:
Describe the three important constructs to solve a given problem. [5 marks]
Question:
How can we increase the size of dynamic allocated memory in C? [5 marks]
Question:
Does the following statement create new variable? If not, why? [1 marks]
int &ref = val
Question: [10 marks]
Write a program which contains a class Account. The class should contains
three data members Name, AcNo. and Balance. The class shouls further
contains two constructors i.e. default constructor and parameterized
constructor. Overload the stream insertion operator (<<) for this class.
Collected and Composed by Bilal Farooq ([email protected])
Question: [10 marks]
Write a program that reads a number that says how many integer numbers
to be stored in an array. Create an array to for the exact size of data and read
in that many numbers into the array.
There were 30 MCQs among which following three:
1) C/C++ string constant is enclosed in
Small braces
Curly braces
Double quote
Single quote
2) Unary operator takes orgument
Zero
One
Two
Three
3) When define array of objects
Constructor will call
Destructor will call
CS201 Fall 2010 Paper # 03
Question:
What is self assignment mean, why should it be avoided? [3 marks]
Question:
Is it possible to overload operators for primitive data type? Justify [3 marks]
Collected and Composed by Bilal Farooq ([email protected])
Question:
What are the limitations of the friendship relations between classes? [3 M]
Question:
C and C++ are free format languages. What does mean by free format? [2
M]
Question:
What are the two types of conversions for user defined data type? [1 marks]
Question:
Describe the three important constructs to solve a given problem. [5 marks]
Question:
How can we increase the size of dynamic allocated memory in C? [5 marks]
Question:
Does the following statement create new variable? If not, why? [1 marks]
int &ref = val
Question: [10 marks]
Write a program which contains a class Account. The class should contains
three data members Name, AcNo. and Balance. The class shouls further
contains two constructors i.e. default constructor and parameterized
constructor. Overload the stream insertion operator (<<) for this class.
Question: [10 marks]
Write a program that reads a number that says how many integer numbers
to be stored in an array. Create an array to for the exact size of data and read
in that many numbers into the array.
Collected and Composed by Bilal Farooq ([email protected])
CS201 Fall 2010 Paper # 04
Q1: 2 marks.
What is meant by constructor conversion?
Q2: 2 marks
Can we overload new and delete operatore?
Q3: Syntax of class template. 2 marks
Q4: It was also of 2 marks
Q5: what is alternative of setw? 3marks
Q6: syntax of switch statements. 3 marks
Q7.If object of class A is call as data member of object of class B, then
constructor and destructor of which class called first? 3marks
Q8: How do we can find the memory allocation has been done by using
new operator? marks 5.
Q9: What is meant by garbage collection in JAVA,C++? 5marks
Q10: It was a program in which we have to write operator for (>>) operator.
5 marks
This was subjective in objective all MCQS and blanks was from OLD
solved papers these were total 26 in numbers.
CS201 Fall 2010 Paper # 05
It had total 36 questions, out of which:
26 MCQs of marks 1 each
4 short questions of marks 2 each
3 short questions of marks 3 each
3 short questions of marks 5 each
Collected and Composed by Bilal Farooq ([email protected])
Some of the short questions that I remember were:
- In one question of marks 5, a code was given and we were asked to point
out errors in it, correct it and write the output (it was a simple code, with a
simple class)
- In another question of marks 5, a simple code was given, code contained a
class, and we were asked to write overloaded stream insertion << operator
for the class
- Alternative of setw manipulator
- What is the benefit of reference? Where we can use it?
- what is the first parameter of overloaded stream insertion operator and
extraction operator functions?