Defining polymorphism-friend function- inheritance-exception


Question 1:                   

(a) Describe why Object Oriented Programming approach is better than Structured Programming Approach.                                                       

(b) Write the simple C++ program to describe basic structure of C++ programming.

(c) Describe the usage of the following C++ operators with the help of the example program.    

(a) sizeof operator

(b) Logical Operators

(c) Scope resolution operator

Question 2:                   

(a) Explain class Book with all basic attributes like title, author, publisher, price etc. Define default constructor, member functions display_data() for displaying the Book details. Use suitable access control specifiers in this program.

(b) Describe the following terms in the context of object oriented programming. Also describe how these concepts are implemented in C++ by giving the example program for each.    

(a) Abstraction

(b) Encapsulation

(c) Operator Overloading

(d) Static Member

Question 3:                    

(a) Define polymorphism? What are various forms of polymorphism? Describe implementation of polymorphism with the help of the C++ program.

(b) Define friend function? How it is implemented in C++? Describe advantages of using friend function with the help of the example.

Question 4 :                   

(a) Describe the following functions for manipulating file pointers, with the help of example program:

• seekg()

• seekp()

• tellg()

• tellp()   

(b)Explain exception? How an exception is different from an error? Describe how exceptions are handled in C++, with the help of the example program.

Question 5:                   

(a) What do you understand by template? Write suitable statements to create a template class for Stack data structure in C++.

(b) What is inheritance? What are various types of inheritance? Describe advantages of using inheritance.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Defining polymorphism-friend function- inheritance-exception
Reference No:- TGS02167

Expected delivery within 24 Hours