OBJECT ORIENTED PROGRAMMING AND C++ Question Papers
(Common to B.Sc. Information Technology)
PART A – (10 X 2 = 20 marks)
1. Define Object Oriented Programming.
2. What is typecasting ? What are explicit and implicit type conversions?
3. Compare objects and classes.
4. Can a overloaded function be default argumented?
5. What is the limitation of unary operator overloading? How it is solved?
6. Can a constructor be private? Is so what it means, how to use it as a private?
7. C++ require that when a desired class object is created a base class constructor if one exists be invoked. Why it is so?
8. Why it does not make a sense for a virtual method to be static?
9. What is the role of isostream.h and iomanip.h header files?
10. Differentiate binary and ASCII file.
PART B ( 5 X 16 = 80 marks)
11. (i) Explain the feature of OOP. (8)
(ii) Write a C++ program to find the sum of the digits of a given number (8)
12. (a1) What is a qualifier ? Explain various qualifiers used in C++ (8)
(a2) What are strings? Are they standard or derived data types? Write an
interactive program to check whether a given string is a palindrome or not?
What happen if the end of string is missing? (8)
(or)
(b) What are command line arguments? Explain with an example. (6)
13. (a1) Write a program to keep track of number of instances created, alive and
destroyed using members, constructor and destructors. (6)
(a2) What is nested class? How does it differ from local class? Create a date as
a nested class of student qualifier class and do the manipulation of reading
and printing the date of birth and date of joining, of a student. (10)
(b) Write a program called vector with one indirection pointer as its data member.
Overload the operators.
( ) – set the value of the object
[ ] – get the value of individual element
New – to allocate memory location
Delete – to deallocate the memory location
14. (a) Design three class student, exam and results, where result in inherited from
exam and exam is inherited from student. Write possible constructors to
initialize the values. Write a main function to test the constructor execution by
creating objects. (16)
Or
(b) Can a constructir be virtual ? What is the use of virtual constructor? How
dynamic binding is achieved in the following program ?
Class X {
Int x;
Public :
Void read ();
};
Public:
Virtual void read ( ) ;
Void print ( ) ;
};
Class Z {
Int b ;
Public :
Virtual void read ( );
Virtual void print ( );
}; (16)
15. (a1) Create a class classed item with necessary data member and member
functions. Write a custom manipulator to print $ before the rate of an item.
(a2) Explain the iostream class hierarchy along with its member.
Or
(b1) Explain about the file opening modes and error handling functions (8)
(b2) Write a program to create a file called emp.dat with employee number, name,
BP, deductions and allowances as record fields. Open a file read the record
Calculate the salary and write it back to the same file. (8)
0 comments :
Post a Comment