APRIL 2018 C++ MSC-IT MADRAS UNIVERSITY QUESTION PAPER

APRIL 2018 SUBJECT CODE:PSB1A

PART-A(10 X 1 = 10)

1 .How many bytes are occupied by the float datatype in a 32-bit system.
2. If three objects of a class are defined ,how many copies of that class's data items are stored in memory?.How many copies of its member functions.?
3. Assuming that class X does not use any overload operators ,write a statement that subtracts an object of class X,say x1,from another such object x2,and places the result in x3.
4. If a base class and a derived class each include a member function with the same name,which member function will be called by an object of the derived class,assuming the scope resolution operator is not used.
5. Write a statement that displays the address of the variable test.
6. Write the declaration of a copy constructor for the class called Person.
7. Name three stream classes commonly used for disk I/O
8. When is actual code for a template function generated.
9 .In the worst case,what is the number of comparison needed to search a singly linked list of length n for a given element.
10. How many edges are there in a minimum spanning tree of a graph with nine vertices.
11.The elements of Linear lisr L=[0,1,2,3,4].Waht will be the result of circular shift operation when the elements of L are rotated clockwise by 2?
12. Which data structure is required to evaluate a postfix expression?.

PART-B(5 X 5= 25 MARKS)

13. Explain function overloading with an example.
14. What is a friend class?.What is the access control a friend class has over the member function?
15. Describe the unformatted I/O operations used in c++
16. How will you define custom exceptions in c++?Give an example.
17. Write an algorithm to move a node forward by n positions in a circularly singly linked list.
18. Using Queue how will you convert a binary tree to a threaded binary tree?
19. Explain any two graph representation techniques.

PART-C(4 X 10 = 40 MARKS)

20. Write a c++ program to create a base class called house.There are two classes door and window available.The house class has members which provide information related to the area of construction,doors and windows details.It delegates responsibility of computing the cost of doors and window construction to door and window classes respectively.Write a c++ program to model the above relationship and find the cost of constructing the house.

21. a) What is a virtual function?Explain with an example.
     b). Write a c++ program to read a line and find out the number of vowels and consonants present in the given line.
22. Describe the type of template supported in c++.Give syntax for each type.Write a generic function to determine maximum of two values and test the function with two integers,two floating point numbers and two double values.
23. Explain Input/Output operators overloading with an example.
24. Given a 2D array A[1:m,1:n] write a pseudo code to perform the following.
a) Check if it is an identity matrix.
b)Find the transpose of the matrix.
c)find the sum of non-diagonal elements of a square matrix
d)To print the upper and lower triangle matrices of a square matrix.
25. Describe the basic operations that can be performed on a binary search tree.

No comments:

Post a Comment