Professional Documents
Culture Documents
1
42
Question Paper Code : T3028
Third Semester
(Regulation 2008)
1
Answer ALL Questions
42
PART A — (10 × 2 = 20 Marks)
9. What are the file stream classes used for creating input and output files?
10. List out any four containers supported by Standard Template Library.
PART B — (5 × 16 = 80 Marks)
1
11. (a) (i) Explain the idea of Classes, Data abstraction and encapsulation.
42
(8)
(ii) Write a C++ program that inputs two numbers and outputs the
largest number using class. (8)
Or
(b) (i) What are the rules to be followed in function overloading. (4)
(ii) Write a C++ program that can take either two integers or two
floating point numbers and outputs the smallest number using
class, friend functions and function overloading. (12)
Or
(b)
1
Write a C++ program that takes two values of time (hr, min, sec) and
42
outputs their sum using constructors and operator overloading. (16)
13. (a) (i) Write the syntax for member function template. (4)
(ii) Write a C++ program using class template for finding the scalar
product for int type vector and float type vector. (12)
Or
Or
2 T 3028
(b) (i) Explain the need for pure virtual functions. (4)
1
(ii) Write a C++ program for calculating the area of rectangle and circle
42
using run-time polymorphism. (12)
15. (a) (i) Explain any two functions used for manipulating file pointers. (4)
(ii) A data file ‘‘DATA’’ contains the name and marks of a set of
students. Write a C++ program that reads the contents of this file
into an object, sorts the data in descending order of marks and
writes the result to an output file ‘‘OUTPUT’’. (12)
Or
(ii) Write a C++ program using lists from STL to input 10 numbers and
store them in a list. From this list, create two more lists, one
containing the even numbers, and the other containing the odd
numbers. Output all the three lists. (12)
1
———————————
42
1
42
3 T 3028