OOPS Practice Questions Done

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

OOP CT-1 PRACTICE QUESTIONS

1. State any four object-oriented languages. (Done)


2. Difference between OOP and POP. (Done)
3. Define class and object. (Doen)
4. Define constructor. List types of constructors. (Done)
5. State the use of cin and cout.(Done)
6. Explain different access specifiers used in C++. (Done)
7. What is inheritance? List different types of inheritance. (Done)
8. Give the syntax of class. (Done)
9. Explain any four applications of OOP(Done).
10. State the use of static data member of a class. (Done)
11. Differentiate between Constructor and Destructor (Done)
12. Explain with the suitable diagram structure of C++ program. (Done)
13. a C++ program to find out whether the given number is even or odd (take number as input from
user). Write (Done)
14. Write a C++ program to declare a class “Student” having data members rollno, name and
percentage. Accept and display data for one Student. (Done)
15. Explain use of friend function with the help of suitable example. (Done)
16. Describe how memory is allocated to objects of class with suitable diagram. (Done)
17. Write a C++ program to declare a class ‘Account’ with data members as accno, name and bal.

Accept data for eight accounts and display details of accounts having balance less than 10,000.(Done)
18. Write a C++ program to declare a class student with members as roll no, name and department.
Declare a parameterised constructor with default value for department as ‘CO’ to initialize
members of object. Initialize and display data for two students. (Done)
19. Describe following terms: Inheritance, data abstraction, data encapsulation, dynamic binding.
20. Describe concept of type casting using suitable example.
21. Write any two characteristics of static data member. Write C++ program to count number of
objects created with the help of static data member. (Done)
22. Write a C++ program to swap the values of two variables using friend function. (Done)
23. Describe visibility modes and their effects used in inheritance.
24. Write a C++ program to find the area of rectangle using class rectangle which has following details
– a) Accept length and breadth from the user. b) Calculate the area.
c) Display the result. (Done)

25. Write a C++ program to display the sum of array elements of size n. Take the array elements as
input from the user.(Done)

26. Differentiate between C and C++ (Done)

27. Explain inline member function.

28. Differentiate between Constructor and Destructor (Done)

29. Write a C++ program to find factorial of given number using loop (Done)

30. Write a C++ program to find smallest number from two numbers using friend function. (Hint: use
two classes). (Done)

31. Write a C++ program to declare a class student with data members as roll no and name. Declare a
constructor to initialize data members of class. Display the data. (Done)

You might also like