UNIT I
1. What are the different ways to define member function of a class? Give example of
each
2. Define inline function. Write a C++ program for finding the area of a triangle using
inline functions.
3. Compare Procedure oriented programming vs object-oriented programming
4. Write C++ code that defines a class and declares an array of objects to that class
5. Explain friend function with example
6. Explain the features of object-oriented Programming
7. What is inline function? Explain with suitable program
8. What is static data member? Explain with suitable example
9. What are inline functions? What are their advantages? Give an example
10. What do you mean by constructor and destructor? Write appropriate C++ program
which uses copy constructor
11. What is friend function? Explain with suitable example
12. Compare and contrast memory allocation and deallocation using new and delete
13. Define constructor, destructor. Write a program to explain use of new, delete,
constructor and destructor
14. What is static member function/ Explain with suitable example
15. What is dynamic memory allocation? Explain its use in C++ with a suitable example
16. What are primitive data types and user defined data types?
17. What is class and object? Differentiate between class and object
18. Write a program which uses default constructor, parametrized constructor and
destructor
19. Consider the following declarations
Class TRAIN
{
int trainno;
char dest[20];
float distance;
public:
void get();
void put();
void show();
};
Complete the member functions definitions
20. Define class number which has inline function mult() and cube() for calculating the
multiplication of 2 double numbers given and cube of the integer number given
21. Write a short note on Reference variable with example
22. Explain array of objects with example