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.

CS304 All Current Final Term Papers Fall 2012 (20 February to 03 March 2013) at one Place

From 20 February to 03 March 2013 Fall 2012

Current Final Term Papers Fall 2012 Papers, Feb 2013 Final Term Papers, Solved Final Term Papers, Solved Papers, Solved Past Papers, Solved MCQs

 

Please Share your Current Papers Questions/Pattern here to help each other. Thanks

Views: 2408

Replies to This Discussion

papa ke pari thanks for sharing 

Note for All Members: You don’t need to go any other site for current Final Term papers fall 2012, Because All discussed data/sharing of our members in this discussion are going from here to other sites. You can judge this at other sites yourself. So don’t waste your precious time with different links.

lasst 10 chapters are important

mcqs were past papers... questions and mcqs related frm inheritance, function, tempelates 



Read more: Today's paper 24-02-2013 - Virtual University of Pakistan http://vustudents.ning.com/group/cs304objectorientedprogramming/for...

my today's paper

There was 40 Mcqs mostly from past papers.......

 2 marks Questions: 1.Describe the way to declare template class as a friend of any other class?

2. Explain statement below

Vector ivec (4, 3);

3. You are required to list down default access specifier for c++ class and c structure.

4. State two reasons why virtual method cannot be static.

 3 Marks Questions.

1. Describe three properties necessary for a container to implement generic algorithm.

2. In both virtual inheritance and multiple inheritance copy/copies of base class are created, List down how many copy/copies are created for:

virtual inheritance

Multiple inheritance

3. Do you think that encapsulation is used to cope with complexity and simplifies the model and provide better understand? Explain the said perceptively with one real word example.

5 Marks Question: 

1. Write the average function that returns the average of all the element of an array. The argument to the function should be array name and the size of the array (type int)

2. There was a program with this question

Identify concrete and abstract classes.

Total Question 52

Total Marks 80

40 MCQ’S

4 Question 2 marks

4 Question 3 marks

4 Question 5 marks

 

50 % mcq’s from past papers

And long questions are given below

 

1-    describe a way to declare a template function as a friend of any other class. marks 2

Answer:      

template< class T >

class B {

int data;

friend void doSomething( T ); // granting friendship to template

doSomething in // class B

friend A< T >; // granting friendship to class A in class B

};

2-    What do you know about function Template?  2 marks

Answer:

Function templates are used when we want to have exactly identical operations on different data types in case

of function templates we cannot change implementation from data type to data type however we can specialize

implementation for a particular data type.

3-    What do you mean by Stack unwinding?  2 marks

Answer:-

The flow control ( the order in which code statements and function calls are made) as a result of throw statement is referred as “stack unwinding”

4-    What will be the output after executing the following code? 3 marks  

class c1{

public: 

virtual void function(){

cout”I am in c1”endl;

}

 

};

class c2: public c1{

public:

void function(){

cout”I am in c2”endl;

 

}

 

};

class c3: public c1 {

public:

void function(){

cout”I am in c3”endl;

}

 

};

 

int main(){

 

c1 * test1 = new c2();

c1 * test2 = new c3();

test1->function();

test2->function();

system(“PAUSE”);

return 0;

}

Answer:- 

I am in c2

I am in c3

5-     What is nested function and also give the syntax?  3 marks

6-     Ek question no 4 ki tra ka tha out put show krna tha  [topic (class)] . . . 5 makrs

(ye nahe hai pr same isi tra ka tha)

What would be the output of this code?

class mother {

  public:

    mother ()

  { cout "mother: no parameters\n"; }

    mother (int a)

      { cout "mother: int parameter\n"; }

};

class daughter : public mother {

  public:

    daughter (int a)

      { cout "daughter: int parameter\n\n"; }

};

class son : public mother {

  public:

    son (int a) : mother (a)

      { cout "son: int parameter\n\n"; }

};

int main () {

  daughter rabia (0);

  son salman(0);

  

  return 0;

}

 

Answer:

mother: no parameters

daughter: int parameter

 mother: int parameter

son: int parameter

 

7-    Ek template ka qstion tha js me int type age size tha average nkani thi with usage of array . . .  5 marks

8-       How can we set the default values for non type parameters? . . 3 marks

Answer:-

We can set default value for this non type parameters, as we do for parameters passed in ordinary functions,

template< class T, int SIZE = 10 >

class Array {

private:

T ptr[SIZE];

public:

void doSomething();

}

9-    Ek question me coding ki hui thi us me srf abstract or concrete alag krna tha ? 5 marks

(sorry ye question sahi tra yad nahe hai)

Baki k qstion yad nahe aa rahay sorry for that . . . .

 Best of luck & also pray for me 

H0nEst_Per$0n gud keep it up & thanks for sharing ur paper 

my today's paper

There was 40 Mcqs mostly from past papers.......

 2 marks Questions: 1.Describe the way to declare template class as a friend of any other class?

2. Explain statement below

Vector ivec (4, 3);

3. You are required to list down default access specifier for c++ class and c structure.

4. State two reasons why virtual method cannot be static.

 3 Marks Questions.

1. Describe three properties necessary for a container to implement generic algorithm.

2. In both virtual inheritance and multiple inheritance copy/copies of base class are created, List down how many copy/copies are created for:

virtual inheritance

Multiple inheritance

3. Do you think that encapsulation is used to cope with complexity and simplifies the model and provide better understand? Explain the said perceptively with one real word example.

5 Marks Question: 

1. Write the average function that returns the average of all the element of an array. The argument to the function should be array name and the size of the array (type int)

2. There was a program with this question

Identify concrete and abstract classes.

CS304 – OOPS   Final Term Current  Papers! 2013

Attachments:

1- What will be the output after executing the following code? 3 marks 

class c1{

public:

virtual void function(){

cout”I am in c1”endl;

}



};

class c2: public c1{

public:

void function(){

cout”I am in c2”endl;



}



};

class c3: public c1 {

public:

void function(){

cout”I am in c3”endl;

}



};



int main(){



c1 * test1 = new c2();

c1 * test2 = new c3();

test1->function();

test2->function();

system(“PAUSE”);

return 0;

}

2- How to implement abstraction in c++.

3-  How to declare friend function , write structure.   
Mcqs kush new the kush old papers mai se , aur 12 short question mai se 8 coding wale the , 3 mai batna tha ke is code ka output kiya hai , ek question tha jis mai "-" operator ko override karna tha , aur is ka final code lakhana tha.

Baki ALLAH kare aap sub ke papers ache  se ho jaye ameen. 

student thanks for sharing ur paper 

Note for All Members: You don’t need to go any other site for current Final Term papers fall 2012, Because All discussed data/sharing of our members in this discussion are going from here to other sites. You can judge this at other sites yourself. So don’t waste your precious time with different links.

CS304 Current pprs ( 22 feb to 6 march ) here ... !!!

Describe cache handler. (2)
Can an object have more then one aspects? Describe briefly (3)
There are some errors in the code given below, you have to Indicate the line no. with error/s Give the reason for error/s Correct the error/s. (5)
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. };
11.
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. }
What will be the output after executing the following code? (5)
class c1

public: virtual void function()

cout”I am in c1”endl; 

}; 
class c2: public c1
{ public: void function()
{ cout”I am in c2”endl; 

}; 
class c3: public c1 

public: void function()

cout”I am in c3”endl; 

}; 
int main()

c1 * test1 = new c2(); 
c1 * test2 = new c3(); 
test1->function();
test2->function(); 
system(“PAUSE”); return 0; 
}

Permalink Reply by zeemal 7 hours agoDelete

my paper

CS304

Syntax of nested try catch ? 5

Write the code for setindex and getindex in following program? 5

Template <class T>

Class Vector

{ int index;

   Int size;

Public:

Int getIndex( )const{};

Void setIndex( int i);

}

 Mobile an entity write its unique id, and 2 behaviour charestics/ 3

In hospital beds are assigned to patients by administration write its OO model and identify objects and their interaction? 5

how do compilers handle all the virtual function calls?Why virtual fuctions cant be run within constructor? 5

why template parameters are used? 2

Wtire 2 differences in information hiding and encapsulation? 2

Explain the statement? 2

Vector <int> ivec(4,3);

Write the output of following 5

template< class T >

                class A

                {

                template< class T >

                 void test< T* >()

{cout”im in test 1”;}

                { … };

template< >

void test< int >()

{cout”im in test 2”;}

 

int main() {

                A< int* > obj1;

A< float > obj2;

Obj1.test() ;

Obj2.test() ;

                return 0;

};

 

Find error ? handouts page 298

 

/*************************************************************

One template function and one template class

**************************************************************/

template< class U >

void doSomething( U ); // template function with template parameter U

template< class V >

class A { … };  // template function with template parameter V

 

/*************************************************************

Making template function and template class friends of class B

Note that in code of class B below we are using same type parameter T for instantiating template function doSomething and template class A.

**************************************************************/

template< class T >

class B {

            int data;

            friend void doSomething( T );  // granting friendship to template doSomething in // class B

            friend A< T >;  // granting friendship to class A in class B

};

 

/*************************************************************

Implementation of template function doSometing and template class A

As we have used same type parameter T in class B for declaring doSomething and class A as friend so now we can only instantiate object of class B according to the passed parameter

**************************************************************/

 

template< class U >

void doSomething( U u ) {    // here template T will be passed as U

            B< U > ib; 

    // it is OK as we are instantiating class B for same type that is passed from class B i.e // T

            ib.data = 78;

}

int main() {

            int i = 5;

            char c = ‘x’;

            doSomething( i );       // OK

            doSomething( c );      // Error!

            return 0;

}

 



Read more: Today Paper CS 304 ( 23Feb2013 to 3 march ) - Virtual University of... http://vustudents.ning.com/group/cs304objectorientedprogramming/for...

My Paper 27/02/2013

  1. Function templates?
  2. There are some errors in the code given below, you have to Indicate the line no. with error/s (code is about This is class 2)
  3. Abstraction? And its uses?
  4. Name of error handling any two.
  5. what about static variable when non-static variable are intiiolize?
  6. in which situation virtual inheritance needed?
  7. find coding error from resource management topic

What is the output produced by the following program?

#include<iostream.h>

void sample_function(double test) throw (int);

int main()

{

try

{

cout ”Trying.\n”;

sample_function(98.6);

cout “Trying after call.\n”;

}

catch(int)

{

cout “Catching.\n”;

}

cout “End program.\n”;

return 0;

}

void sample_function(double test) throw (int)

{

cout “Starting sample_function.\n”;

if(test < 100)

throw 42;         

}

  1. write a template function maximum which takes two arguments of same type, that returns the larger number
  2. write a template function which gives average having it’s name and proper size of array. 

RSS

Looking For Something? Search Below

Top Trends 

Latest Activity

Ziddi Programmer commented on + M.Tariq Malik's page Chit Chat Wall
1 hour ago
Ziddi Programmer replied to Mr Siren Head's discussion Ning Chats
1 hour ago
Ziddi Programmer liked Mr Siren Head's discussion Ning Chats
1 hour ago
Mr Siren Head replied to + !♛EMAN FATIMA!'s discussion Course Selection
2 hours ago
mumtaz Muddasir Yasin is now a member of Virtual University of Pakistan
3 hours ago
Saeed liked Mehreen Tasneem's profile
yesterday
Mehak commented on + M.Tariq Malik's page VULMS Login Here
yesterday
Mr Siren Head replied to Mr Siren Head's discussion Ning Chats
Sunday

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

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

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