2075 Chaitra Regular engineering note
2075 Chaitra Regular Object-Oriented Programming IOE Pulchowk engineering note
1. What are the main features of Object-Oriented
Programming? Would you consider it better than structured programming? If you
do, what makes it better? Write down its advantages and disadvantages.
2. What do you mean by constructor and destructor? Explain the necessity of copy constructor with example. Also, explain the order of the invocation of constructor and destructor with example.
3. What type of language is C++? Explain its features.
4. What is function overloading? How is pass by reference done in C++? Explain with a suitable example.
5. Write the syntax of operator overloading. Create a class called time that has separate int member data for hours, minutes, and seconds. One constructor should initialize this data to zero (0), and another should initialize it to fixed values. A member function should display it in 10:45:30 format. The final member function should add two objects of type time passed as arguments using operator overloading.
6 How the function overriding differ from function overloading? When do we face ambiguity problems in multiple inheritances? Explain.
7. What is pure virtual function? Discuss the role of virtual functions in C++ to cause dynamic polymorphism. Show with an example of how it is different from the compile-time polymorphism.
8. What are different file access pointers? Write a program to store and retrieve the information of the Client(Client ID, Account ID, name, address, and age) in the Bank management system. Also, calculate the total number of clients in a bank.
9. Explain the function template? How do you use the function template with multiple template types? Give an example
10. What is an exception and what is the mechanism of exception handling in C++? Write a program to illustrate the process of handling multiple exceptions.
2. What do you mean by constructor and destructor? Explain the necessity of copy constructor with example. Also, explain the order of the invocation of constructor and destructor with example.
4. What is function overloading? How is pass by reference done in C++? Explain with a suitable example.
5. Write the syntax of operator overloading. Create a class called time that has separate int member data for hours, minutes, and seconds. One constructor should initialize this data to zero (0), and another should initialize it to fixed values. A member function should display it in 10:45:30 format. The final member function should add two objects of type time passed as arguments using operator overloading.
6 How the function overriding differ from function overloading? When do we face ambiguity problems in multiple inheritances? Explain.
7. What is pure virtual function? Discuss the role of virtual functions in C++ to cause dynamic polymorphism. Show with an example of how it is different from the compile-time polymorphism.
8. What are different file access pointers? Write a program to store and retrieve the information of the Client(Client ID, Account ID, name, address, and age) in the Bank management system. Also, calculate the total number of clients in a bank.
9. Explain the function template? How do you use the function template with multiple template types? Give an example
10. What is an exception and what is the mechanism of exception handling in C++? Write a program to illustrate the process of handling multiple exceptions.
0 Comments:
Post a Comment
Please don't enter any spam link in the comment box