+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Tags:
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)Share Your Final Term Papers (Questions/Pattern) & Past Papers as well here to help each other. Thanks
Note:-
For Important Helping Material related to this subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ,Short Questions Answers & more). You must view all the featured Discussion in this subject group.
For how you can view all the Featured discussions click on the Back to Subject Name Discussions link below the title of this Discussion & then under featured Discussion corner click on the view all link.
Or visit this link
&
.•°How to Download past papers from study groups°•.
Please Click on the below link to see…
cs304 final paper pattern question share plz
CS304 today's paper
Q1) What will be the output of the code given below?
#include <iostream.h>
#include <stdlib.h>
using namespace std;
template <typename T>
class MyClass{
public:
MyClass(){
cout"This is class1"endl;
}
};
template <typename T>
class MyClass<T*>{
public:
MyClass(){
cout"This is class2"endl;
}
};
template <>
class MyClass<int>{
public:
MyClass(){
cout"This is class3"endl;
}
};
int main(int argc, char *argv[])
{
MyClass<int> c1;
MyClass<char*> c2;
MyClass<float> c3;
system("PAUSE");
return 0;
}
Q2) Explain precisely the role of copy constructor in case of dynamic memory allocation
Q3) Examine the following code and determine the output of the program:
#include<iostream>
#include<conio.h>
using namespace std;
class A
{
public:
void method() { cout"A's method \n"; }
};
class B : public A
{
public:
void method() { cout"B's method\n"; }
};
int main()
{
A obj1;
B obj2;
A* aptr;
aptr = & obj2;
obj2. method();
aptr -> method();
system("pause");
}
Q4) What do you mean by Catch Handler?
Q5) Override Sing function of Parent class. Only write prototype of function.
class Toy {
public:
void Sing();
};
class Doll: public Toy {
public:
};
Q6) Explain public and private inheritance with example?
Q7) What is virtual function? Explain it with coding example.
Q8) Write a template function that returns the average of all the elements of an array. The arguments to the function should be the array name and the size of the array (type int).
Q9) What is the output of 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";
system("pause");
return 0;
}
void sample_function(double test) throw (int)
{
cout "Starting sample_function.\n";
if(test < 100)
throw 42;
}
Q10) Write C++ code for a class ABC with one static data member count which counts the number of objects created. Create three objects in main and print the value of count in main().
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post