IGNOU MBA Assignment, Solved IGNOU MBA Assignments

CC-16 Introduction to C++ June 2010 – Question Paper

1. (a) Create a class “My string”. Write the following methods in this class to perform the actions mentioned :

(i) Reverse ( ) : To display the reverse of the given input string.

(ii) String Len ( ) : To display the length of the given string.

(b) Write a program in C++, using recursion to find the factorial of a given number. Your program should also provide the standard checks on input like number should not be negative.

(c) Write the syntax of the following in C++ and give an example for each :

(i) Do.. While

(ii) GoTo

(iii) BREAK.

(d) What are nested classes ? Explain with an example.

2. (a) Write a program in C++ to illustrate the multiple inheritance concept.

(b) How is exception handling performed in C++ ? Write a program-segment that throws an arithmetic exception as and
when an input number is greater than 9999.

3. (a) Write a program in C++ to count the occurrences of each vowel in a given string.

(b) With the help of a suitable example for each, explain the visibility modes (private, public and protected).

4. (a) Write a program in C++ to add two matrices.

(b) Explain the concepts of function overloading and operator overloading with the help of an example.

5. Explain the following with their usage in C++ programming :

(a) Friend function

(b) Arithmetic If operator

(c) Size of operator

(d) Scope resolution operator

(e) Abstract class