0% found this document useful (0 votes)
11 views

Unit 2 Assignment Questions OOP

Uploaded by

vadnalrajveer14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Unit 2 Assignment Questions OOP

Uploaded by

vadnalrajveer14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Unit-2 Functions and Constructors

1. Describe use of static data member. (S-19, W-18)

2. Write a C++ program to find smallest number from two numbers using
friend function. (S-19)

3. Differentiate between constructor and destructor. (S-19)

4. Write a C++ program to declare a class student with members as roll no,
name and department. Declare a parameterized constructor with default
value for department as ‘CO’ to initialize members of object. Initialize
and display data for two students. (S-19)

5. Write two properties of static member function. (W-19)

6. State the rules for writing destructor function. (W-19)

7. What is parameterized constructor? (W-19)

8. Explain the friend function with proper example. (W-19)

9. Write a program to declare a class ‘student’ having data members as


‘stud_name’ and ‘roll_no’. Accept and display this data for 5 students.
(W-19)

10. Describe use of protected access specifier used in the class. (W-18)

11. Write any two characteristics of destructor. (W-18)

12. Write a C++ program to declare a class addition with data members as x
and y. Initialize values of x and y with constructor. Calculate addition and
display it using function ‘display’. (W-18)

13. Write a C++ program to swap two integer numbers and swap two float
numbers using function overloading. (W-18)

14. Write a C++ program to find greatest number among two numbers from
two different classes using friend function. (W-18)

15. 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. (W-18)

You might also like