Monday, November 15, 2010

Jawaharlal Nehru Technological University, Hyderabad M.C.A -I Semester Supplementary Examinations July 2010 OBJECT ORIENTED PROGRAMMING THROUGH C++ Question paper

Code No: 13

Time: 3hours Max.Marks:60

Answer any Five questions
All questions carry equal Marks
- - -
1.a) Differentiate between break and continue statements with an example.
b) Write a program to display the following output.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

2.a) Explain the copy constructor with an example.
b) Write a program to subtract a complex number object from another using friend function.

3.a) Explain the function overloading with an example.
b) Write a function template for finding the minimum value contained in an array.

4.a) What are virtual and pure virtual functions? Use this concept to draw a square and a rhombus.
b) Write a program to simulate a game involving gambling. A player should play with some money on some number. The amount returned should depend on five different functions. Which function is to be applied is decided randomly. Functions should be referenced with a pointer.

5.a) Write a program to decrypt an encrypted file.
b) What is an exception? How is an exception handled in C++?

6.a) Write a program that will read a line of text containing more than three words and
then replace all the blank spaces with an underscore.

b) What are the advantages of dynamic memory allocation? Which part of memory is used for dynamic memory allocation?

7.a) Differentiate between function overloading and operator overloading.
b) Write a program to illustrate overloading of "+" operator for adding objects of different class.

8.a) Write a program that reads and displays 'n' characters starting from any position in a file. The program should accept three user-entered items: The name of the file, the offset of the first character to be read and the number of the characters to be read.
b) How does a C++ structure differ from a C++ class?

********
R09

No comments:

Post a Comment