My Profile
Active Members
TodayLast 7 Days
more...
Awards & Gifts
Online Exams
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian
cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
|
Download Model question papers & previous years question papers
|
Posted Date: 22 Oct 2009 Posted By: Gourav Kumar Satpathy Member Level: Bronze
|
2007 Biju Patnaik University of Technology B.Tech Computer Science & Engineering oops Question paper
THIRD SEMSTER 07 OBJECT ORIENTED PROGRAMMING
Question 1(compolosory) (2*10) (a) what is a C++ template? (b) What is the best way to declare and define global variables? (c) What is inheritance and what are the different types of inheritance available in C++? (d) What is constuctor and What is default constructor? (e) What is the diffence between chat a[]="string"; and char *p="string";? (f) How do you decide to which integer type to use? (g) How do you declare a array of N pointers to functions returning pointers to functions returning pointers to Characters? (h) What is "abstraction" and why do we use it? (i) What is invariant? (j) What is the difference among public,protected and private members of a class?
Question 2 (a) How does an inline function differs from preprocessor macro?(2) (b) How is polymorphism is achieved at compile time and run time? Give an example of a program that uses polymorphism.(3) (c) Define a class for a complex number .Write a program to read and print the complex numbers.(5)
Question 3 (a) The voltage gain of an amplifier is given by the formula
where f is the frequecy in Hertz and n is the number of stages in the amplifier. Write a complete C++ program that asks the user to input the values for n and f. calculates the value of the voltage gain using the formula and produces the following display on the terminal screen: At a frequency of X Hertz , the voltage gain is Y. Where X is replaced by the frequency and Y replaced by the voltage gain.(5) (b) Write a function that returns the mean of the n elements of an array of double type.(5)
Question 4 (a) List the three ways of passing a parameter (or return value) in C++. For each indicate: ->Whether the meathod makes a copy of the object passed. ->Whether the method allows passing of constant objects. ->Whether the method supports polymorphism and virtual dispatch. ->Whether the meathod allows implict type conversion to be performed(5) (b) Write a template function "max" that returns the largest element in an array of N elements. YOU can assume that N>1. Select a reasonable and simple interface.(5)
Question 5 (a) What does the reference operator do? What is the difference between passing and argument by reference and passing by Value?(4) (b) Consider the following class Foo, (for which one constructor is written ). Write a destructor, a copy constructor and an assignment operator that would ve appropriate for the class.(6)
Class Foo{ public: int *p; Foo(void){ p=new int[10]; for(int k=0;k<10;k+=1){ p[k]=k; } }
Question 6 (a) Declare a C++ structure to contain the following five pieces of information about cars on a used car lot: 1.the manufacture of the car 2.the model mane of the car, 3.the number of miles on the odometer, 4. the asking price for the car. (4)
(b) Write a template function alloc that takes two parameters: n: The size of the array to allocate val: a value of type T The alloc function should allocate an array of type T with n elements and set all elements in the array to the value val.The pinter to the array is returned.(6) Question 7 (a) Give two different ways that an alias can be created for an integer variable i in C++ program.(4) (b) Write a program that uses a 2-dimensional m*n double array A.Declare the variable A and write the C++ code required to allocate and deallocate the array (assume that m and m are declared and their values known).(6) Question 8 (a) Distinguish between virtual member function and non-virtual member function .(2.5) (b) Why are internal data members of a base class declared protected instead of private?(2.5) (c) Define the terms static scoping and dynamic scoping and give a very simple example of each.(2.5) (d) Explain what the following three lines "do" when executed?(2.5) Tmp=new int (10); *Tmp=65; delete[] Tmp;
Return to question paper search
|
|
|
Submit Previous Years University Question Papers and make money from adsense revenue sharing program
Are you preparing for a university examination? Download model question papers
and practise before you write the exam.
|
Advertise Here
|