Object-Oriented Programming in C++: Exercises and Questions - Prof. Tam, Cheat Sheet of Computer Engineering and Programming

Unit 1 and unit imp question of sppu third sen computer engineering

Typology: Cheat Sheet

2023/2024

Uploaded on 09/30/2023

swapnil-yeole
swapnil-yeole 🇮🇳

1 document

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
pf2

Partial preview of the text

Download Object-Oriented Programming in C++: Exercises and Questions - Prof. Tam and more Cheat Sheet Computer Engineering and Programming in PDF only on Docsity!

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

UNIT II

  1. What is the use of ‘this’ pointer. Explain with example.
  2. What is the difference between pointer and references
  3. Discuss the role of access specifiers in inheritance and show their visibility when they are inherited as public, private and protected
  4. Explain the void and null pointer with example
  5. Write a C++ program to demonstrate the pointers to base and derived classes
  6. How are arrays represented using pointers. Explain with example.
  7. Explain hybrid inheritance with a C++ example
  8. Write a short note on types of inheritance with respect to i) Single ii) Multiple iii) Hierarchical
  9. Explain visibility modes in Inheritance
  10. What is multiple inheritance? What is the ambiguity in Multiple inheritance? Give suitable example to demonstrate Multiple inheritance
  11. What is the concept of function pointers? Give suitable example in C++
  12. What is the difference between Inheritance and Containment
  13. Explain pointer to a variable and pointer to a function. Use suitable example
  14. Write a program to find the sum of an array Arr by passing an array to a function using pointer
  15. Explain public, private and protected keywords using program
  16. Write a program for addition of two numbers using pointer