Skip to content
VUBuddy

CS304 Final Term Solved Subjective Set 2 by VUBuddy

Object Oriented Programming PDF 252 KBUpdated 23 Oct 2026
Final term past paper CS304 Final Term Solved Subjective Set 2 by VUBuddy PDF 252 KB
vubuddy.com
Type
Final term past paper
Course
CS304 Object Oriented Programming
Size
PDF 252 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 252 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 23. Download the file for all 23 pages.

CS304-Object Oriented programming NEW Solved Final terms papers with

references from 2012-2013 by

Q) Describe the way to declare a template function as a friend of any class?(2marks)

Answer: (Page 294)

Template<class U>

Void doSomething (U);

Template<class V>;

Class A{

int data;

Class B{

int data;

friend void doSomething(T);

friend A<T>; int.this function will take 2 parameters one will be pointer and other will be will be size of array (mrk3)

Answer: (Page 257)

Void printArray(T*array,int size)

For(int i=0;i<size;i++)

Cout<<array[i];

int main()

int iArray[5]={1,2,3,4,5};

void printArray(iArray,5);

return 0; Q) Consider the code below,

1. template<typename T> class Test { · 2. T value; · 3. public: · 1. Test( T val ) : value(val){} · 1. Test(const Test<T>& c) : value(c.value) {} · 1. }; · 1. int main() { · 2. Test< int > t1( 0 ), t2( 0 ); · 3. Test< float > t3 = t1; · 4. system("PAUSE"); · 5. return 0; · 6. }

Q) Give line number having any error/errors in this code explain the reason for error/s and give corrected code as well.

Answer: Test< float > t3 = t1; There is an error in this line due to conversion from int to float but in a wrong way

Q) Why Abstract class’s objects cannot be instantiated?

Answer: (Page 230) Abstract class’s objects cannot be instantiated they are used for inheriting interface or implementation so that derived classes can give implementation of these concepts.

All CS304 files →
CS304 Object Oriented Programming All CS304 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.