Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


Current Final Term Papers Spring 2012 Date: 16-July-2012 to 27-July-2012

Current Final Term Papers Spring 2012 Papers, July 2012, Solved Final Term Papers, Solved Papers, Solved Past Papers, Solved MCQs

Views: 3588

Replies to This Discussion

Asalam o Alikum !

agar kisi k pass moaaz k latest CS304 k pastpapers hain tu please yahan share karwa dayyyy..

Thanks

today's paper include question...

define random iterator.what is relation between vector and random iterator?

templates merits and demerits?

make class according to this data:

class name= DOCTOR

attributes= name, salary, design etc

method= eat, walk, treatment etc

next question is different between virtual and multiple inheritance

2 question ay thy coding k js my out ijk all member of test() T1 WALA OR 2nd aya tha correct the coding

1. #include <iostream>
2. #include <stdlib.h>
3. using namespace std;
4. template <typename T>
5. class MyClass{
6. public:
7. MyClass(){
8. cout"This is class1"endl;
9. }
10. };

12. template <typename T>
13. class MyClass<int*>{
14. public:
15. MyClass(){
16. cout"This is class2"endl;
17. }
18. };
19.
20. int main(int argc, char *argv[])
21. {
22. MyClass<int> c1;
23. MyClass<int*> c2;
24. system("PAUSE");
25. return 0;
26.}


baki MSQ's thy past sy 

My Today paper(20-07-2012)

2 marks question

1.Two types of template

2.Explain the statement vector <int> ivec (4,3)

3.Write a template function that return the values of parameter in double (parameter*2)

4.how we specialize a template function for a particular type

 

3 marks questions

1.Why we use friend function in overloading of stream insertion operation and stream extraction operator

2.if iter is an iterator to a container. Write an expression that will have the value of the object pointed to by iterator, and will then cause iterator to point to the next element

3.If we declare a function as friend of a template class will it be a friend for a particular data type or for all data types of that class.

4.A class was given and ask to draw normal form and suppressed form diagram

 

5 marks question

1.What is container class and write its types

Consider the following class, class Base { char * p; public: Base() { p = new char[10]; } ~Base() { delete [] p; } }; class Derived : public Base { char * q; public: Derived() { q = new char[20]; } ~Derived() { delete [] q; } }; void foo() { Base* p = new Derived(); delete p; } With this program, every time function foo is called, some memory will leak. Explain why memory will leak. Also, explain how to fix this problem.

2.The code given below has one template function as a friend of a template class,

1. You have to identify any error/s in this code and describe the reason for error/s.

2. Give the correct code after removing the error/s.

template<typename U>void Test(U); template< class T > class B { int data; public: friend void Test<>( T ); }; template<typename U> void Test(U u){ B < int> b1; b1.data = 7;

 

3.coding was given of one function and ask to change to initialization order of the data members

 

Thanks ✿Bîã✿  

Jasmine Khan………….

MCS

18/06/2012……………….

Current paper of Cs304

Total 52 questions:

4 questions of 2 marks

4 questions of 3 marks

4 questions of 5 marks.

2 mark Questions:

1. Write down a list of four intangible objects?

2. Describe three properties necessary a container to implement generic algorithms.

Answer:- (Page 301) from mooaz file

3. Write three important features of virtual functions

4.

Give the C++ code of template function to print  the values of any type of array I int.this function will take   2 parameters one will be pointer and other will be  will be size of array  ?

3 mark Questions:

1. Describe the salint feature of abstract class (mrk3)

2. define composition and give its example with coding

Answer:- (Page 53)

3. define static and dynamic binding.

Answer:- (Page 227)

4. what is constructor?

Answer:- (Page 74)

5 mark Questions:

1. What is the difference (if any) between the two types of function declarations?

template function_declaration;

template function_declaration;

2. Give three advantages that Iterators provide over Cursors.

Answer: - (Page 311)

3. What are container requirements (5)

4. What is random iterator? What is its relation with vectors?

 

~~~~~~~~~~~~~~~~~~~~~~~(Jasmine Khan)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Jasmine Khan………….

MCS

19/06/2012……………….

Current paper of Cs304

Total 52 questions:

4 questions of 2 marks

4 questions of 3 marks

4 questions of 5 marks.

2 mark Questions:

1. Write three important features of virtual functions

2 Give the name of three operation that a cursor or iterate generally provide?

3. What do you know about function Template? Answer in two line.

4. What is a Virtual Destructor?

3 mark Questions:

1.define static and dynamic binding.

Answer:- (Page 227)

2. What are container requirements?

3. Sort data in the order in which compiler searches a function. Complete specialization, generic

template, Partial specialization, Ordinary function.

4. what is constructor?

5 mark Questions:

1. Describe problems with multiple inheritances?

2.Consider the code below,

template< typename T >

class T1 {

   public:

   T i;

   protected:

   T j;

   private:

   T k;

   friend void Test();

   };

 

This code has a template class T1 with three members i,j and k and a friend function Test(), you have to

describe which member/s of T1 will be available in function Test().

3. Give the c++ code of case sensitive comparison function of string class.

Answer:- (Page 265)

4. Suppose the base class and the derived class each have a member function with the same signature. When you have a pointer to a base class object and call a function member through the pointer, discuss what determines which function is actually called, the base class member function or the derived-class function

~~~~~~~~~~~~~~~~~~~~~~~(Jasmine Khan)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

Jasmine Khan………….

MCS

20/06/2012……………….

Current paper of Cs304

Total 52 questions:

4 questions of 2 marks

4 questions of 3 marks

4 questions of 5 marks.

2 mark Questions:

1.Give two uses of a destructor.

2. Write the syntax of declaring a pure virtual function in a class?

3. What is the purpose of template parameter?

4. Give the names of three ways to handle errors in a program.

3 mark Questions:

1. Describe the way to declare a template class as a friend class of any other class.

2. What is the purpose of template parameter?

3. What is meant by direct base class?

4. State any conflict that may rise due to multiple inheritance?

5 mark Questions:

1. Suppose the base class and the derived class each have a member function with the same signature. When you have a pointer to a base class object and call a function member through the pointer, discuss what determines which function is actually called, the base class member function or the derived-class function

2. What are container requirements (5)

3. Tell the logical error/s in the code given below with reference to resource management; also describe how we

can correct that error/s.

class Test{

public:

int function1(){

                  try{

                        FILE *fileptr = fopen(“filename.txt”,“w”);

                         throw exception();

                         fclose(fileptr);

                         return 0;

                         }

                         catch(Exception e){

                         ...

                         }

}

};

4. In which situation do we need to implement Virtual inheritance? explain with an example

~~~~~~~~~~~~~~~~~~~~~~~(Jasmine Khan)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

 

Attachments:

ic main kuch question bohat repeat hue hain differnt timming main main ne wo ek bar hi likhy hain....

JazakALLAH.............

Thanks again dear sis 

 

Jasmine Khan………….

MCS

21/06/2012……………….

Current paper of Cs304

Total 52 questions:

4 questions of 2 marks

4 questions of 3 marks

4 questions of 5 marks.

2 mark Questions:

1. dynamic and static binding

2. Abstract class ke silent feature

3. describe a way to declare a template function as a friend of any other class
4. Two types of template

3 mark Questions:

1.Give two uses of a destructor.

2 Give the name of three operation that a cursor or iterate generally provide?

3. A class was given and ask to draw normal form and suppressed form diagram

4. What are container requirements?

5 mark Questions:

1. Describe problems with multiple inheritances?

2. Give the correct code after removing the error/s.

template<typename U>

void Test(U);

template< class T >

class B

{ int data;

public:

friend void Test<>( T );

 };

template<typename U>

void Test(U u)

{

B < int> b1;

b1.data = 7;

 

}

int main(int argc, char *argv[])

{

char i;

Test(i);

system("PAUSE");

return 0;

 }

3. Suppose the base class and the derived class each have a member function with the same signature. When you have a pointer to a base class object and call a function member through the pointer, discuss what determines which function is actually called, the base class member function or the derived-class function

4. what is iterator? and what is output and input iterator?


~~~~~~~~~~~~~~~~~~~~~~~(Jasmine Khan)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CS304 Current Spring 2012 Final Term VU Paper [July 2012] Virtual University of Pakistan

1. two advantages of getter function? 2 marks
2. Which is best place to close file in try block of class? (2 marks)
3. Is it possible to make virtual function? VU solutions 2 marks
4. 3 advantage of Iterate over cursors? 3 marks
5. Create a vector array of length 8.
6. Create a vector array of length 8, and also initialize the elements of this array with values 0 1 2 3 4 5 6 7. 5 marks



  • Can a constructor throw an exception? How to handle the errors, when the constructor fails?
  • How can you describe virtual destructor? Why virtual destructor is used?
  • What do you know about exception in initialization?
  • what is iterator? and what is output and input iterator?
  • Describe a way to declare a template function as a friend of any other class.
  • Give three advantages that Iterates provide over Cursors.
  • What do you know about function templates?
  • Give the difference between virtual inheritance and multiple inheritances.

nice sharing zain mahmood 

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service