CS201 Current Spring 2011 Final Term VU Paper [July 2011] Virtual University of Pakistan
Saturday, July 16, 2011 Posted In .Final Term Exam Spring 2011 (July) Edit ThisWeight
Class weight{
Private: …………no 5
Q51: Define the buffer,explain why we r use buffer? …………..no 5
Q 50: Defferentiate between random access and reqyentail access file?? ….no 5
Q48: Conert the following whil loop into a for loop
Int I =1;
While (i<=n)} ……………..no3
Q46 : What is an alternative of the setw mainpulatior? … no 3
Q45: if we want to send the data by refrenceand don't want that original data should be affected then what can we do to prevent any change?? ….. no 3
two different method for converting the NFA to FA 5marks
Explain the decidability and examples. 5marks
similarity and dif b/w DFA and NFA 3 marks
RE for Even-even 2 marks
Infix and prefix notation tree is similar as given in old papers 5 marks
Supponse fuction having argument type U return type T correct syntax pass a variable x of type double and return a int type 2
Declare and initiaze static data member in a class 2
Is there any harm to declare some varibales more than once within two or more function of programe 2
If we want to send the data by reference and don't want that original data should be affected then what we do to prevent this 3
Difference btw static and global variables 3
Find error in for loop statement 3 matrix ka column teekh nai likha tha.
Display the output of following code 3 switch statement thiee
Systax of two way friend relationship between classes 5
What is template function general syntax 5
Fetch maxtrix 2x2 5
Write a programe two variables and display oct hex dec value using setbase(5)
Total 80 Marks
40 Mcqs = 40 Marks
subjective=40 Marks
4 Question = 2Marks
4 Question =3 Marks
4 Question = 4 Marks
Q.41
What does it happen if an object id assign to another object without overloading an assignment operator.2marks
Q.42
Describe the first parameter to stream insertion<<and stream extraction>> operator function? 2Marks
Q.43
Write the meaning of given line code where m is object of class matrix
If (&m! = this)
Q.44
Why always array start with index 0(zero) ? 2Marks
Q.45
What will be the output of following function if we call this function by passing int 5? 3 marks
template T reciprocal(T x) {return (1/x); }
Q.46
Identify all the given functions as member function of input stream or output stream
Get, unget, and put, getline, Peek, Putline, 3Marks
Q.47
Write the general syntax for unary member operator 3Marks
Q.48
Write the output of this code 3Marks
Main()
{
int x,y,z;
x=5;
y=3+x++;
Q.49
What are the advantages and disadvantages of using templates? 5Marks
Q.50
Find the errors in given code and correct them; also write the output of the code-5 Marks
Q.51
Describe the effect of an overflow condition if it occurs within a program 5 Marks
Q.52
Make a program instruction was given in the code 5Marks