Vous êtes sur la page 1sur 7

Assignment

Question 1# How can run time polymorphism be achieved in C++? How are pure virtual functions different from virtual functions? What is the need behind making any function as virtual and pure virtual? Explain with the help of an example.

Question 2# Explain why cant you make virtual constructors? Can you make any non-member function as virtual? Make your comments about virtual destructor.

Question 3# Write all form of inheritances using different visibility mode. Explain with the help of an example.

Question 4# What do you understand by overloaded operator? How overloading can be achieved? Can you overload = operator making the operator function as a friend function? Explain using an example.

Question 5# What is Standard template library? How is it different from the C++ standard library?

Question 6# Differentiate between: i. ii. iii. iv. Late binding vs Early binding Multiple inheritance vs multi-level inhertance Function overloading vs Function overriding Deepcopy vs Shallowcopy

Question 7# What is generic programming? Write a template function for finding the minimum value contained in an array.

Question 8# What is the difference between containership and inheritance? Explain with proper example? Can a class support both of these features simultaneously?

Question 9# What do you mean by type Conversion? How can you convert one user defined data type to another user defined type? Explain in details?

Question 10# Define a class to represent a bank account. Include the followingData members: a) Name of the Depositor c) Type of Account

b) Account No. d) Balance Amount. Member function a) To Assign initial value b) To Deposit an amount c) To Withdraw an amount d) To Display Name of Depositor & Balance. Define all member functions and main () Generate the saving account report slip as an output. Question 10# What are the advantages of using the exception handling in a program? How exceptions are handled in C++? Explain with the help of an example.

Question 11# Write Short notes on: i. ii. iii. Container classes Iterator Vectors

Question 12# Explain the features of Object Oriented Programming. How is it different from structural programming? Question 13# C++ requires that when a desired class object is created a base class constructor if one exists be invoked. Why it is so? Explain with the help of example.

Question 14# Read the piece of code properly and answer the following questions: class Student { int Rno; char Name[20]; float Marks; protected: void result( ); public: Student ( ); void Register ( ); void Display( ); }; class Faculty { long FCode; char FName [20]; protected: float Pay; public: Faculty ( ); void Enter( ); void Show( ); }; class Course: public Student, private Faculty { long CCode [10]; char CourseName [50]; char StartDate [8], EndDate [8]; public: Course( ); void Commence ( ); void CDetail ( ); }; Which type of inheritance is illustrated in the above C++ code?

Write the names of all the data members, which is /are accessible from member function Commence of class Course. Write the names of member functions, which are accessible from objects of class Course. Write the names of all the members, which are accessible from objects of class faculty.

Question 15# What do you mean by type conversion? How you can convert one user defined data type to another user defined type. Explain in detail. Question 16# Define the term Data Hiding in the context of Object Oriented Programming. Give a suitable example using a C++ code to illustrate the same. Question 17# Answer the questions after going through the following class: class Test { char Paper[20]; int Marks; public: Test () // Function 1 { strcpy (Paper, Computer) Marks = 0; } Test (char P [] ) // Function 2

{ strcpy(Paper,P); Marks = 0; } Test (int M) // Function 3 { strcpy(Paper,Computer); Marks = M; } Test (char P[], int M) // Function 4 { strcpy (Paper, P); Marks = M; } }; 1) Which feature of Object Oriented Programming is demonstrated using Function 1, Function 2, Function 3 and Function 4 in the above class Test? 2) Write statements in C++ that would execute Function 2 and Function 4 of class Test. Question 18# i. ii. iii. What is the significance of enum data types in C++? Explain using an example. Illustrate use of new and delete with the help of an example. How static data members are different from non-static data members?

Question 19# What is the purpose of constructors (default, parameterized n copy) & destructors in C++? Explain each in detail.

Question 20# Write a program in C++ to illustrate the overloading of postfix increment operator. Note- You are supposed to overload ++ operator to work with an object obj to deal with cases like obj++.

Vous aimerez peut-être aussi