Object Oriented Programming in C++PU Spring
a) —Create a class Person with data members Name and age. Derive a \8 : ee class Employee from Person with its data member employee id. Derive another class Manager from Employee with its data…
37a)_—Create a class Person with data members Name and age. Derive a \8 : ee class Employee from Person with its data member employee_id. Derive another class Manager from Employee with its data member department. Receive the data_members from each class's member . function and display the data of all classes from the class Manager.
- b) How composition differs from inheritance? Write a program to concatenate two strings (name and address of a person) using the concept of containership.
OR
A oscios the time of hybrid inheritance when there is hierarchical inheritance at the upper level and multiple inheritance at lower level; ambiguity occurs due to duplication of data from multipath at the grand child class. How this kind of ambiguity is resolved? Explain with suitable example. 4, @) What is the major difference between compile time and runtime \ polymorphism? er runtime polymorphism can be achieved? Explain with example. ay What do you mean by type casting? Write a Program toconvertan So ee object of Rectangle class into the object of Polar class by using type conversion routine.
OR
What are functions overloading and overriding? Explain with examples. 5. we What are the advantages of function template? Create a function template to swap two infegers, two floating point data and two characters. b)- What is the Standard Témplate Library (STL)? Explain any one 8° container of STL with example. 6. aa is exception? Describe exception handling in C++ with 7. example. ' Danie a program that prompts the user to enter their name and age, write the entered data into a file named “userinfo.txt”, read the details . from “userinfo.txt” and display the data on the console. 7. Write short notes on: (Any two) 2x5
- a) Software reusability x Ds Dynamic Memory Allocation Oy Computation as simulation Bh TEST TY
Discussion
Loading…