CS304 Finalterm Paper 2013 File 9 Shared by Mohsin Latif

No Comments

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. 

Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment