Unit 2 Assignment Questions OOP
Unit 2 Assignment Questions OOP
2. Write a C++ program to find smallest number from two numbers using
friend function. (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)
10. Describe use of protected access specifier used in the class. (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)