*3100*
3100
(Pages : 2)
Reg. No. : .................................... Name : .........................................
Third Semester B.Tech. Degree Examination, June 2009 Branch : Mechanical Engineering (2003 Scheme) 03-305 : COMPUTER PROGRAMMING AND APPLICATION (MN) Time : 3 Hours
Max. Marks : 100 PART – A
Answer all questions. All questions carry 4 marks each. 1. List the major functions of an operating system. 2. Write a flow chart to find the sum of diagonal elements of a square matrix. 3. Discuss various storage class for data in C++. 4. Show an example of function with default arguments. 5. With suitable examples show the difference between a pointer and a reference. 6. Show how polymorphism can be implemented in C++. 7. List the various type of inheritance in C++. 8. Explain the use of ‘template’ in C++. 9. What is a virtual base class ? 10. Define the following terms with the help of an example : 1) Function over loading. 2) Friend functions. 3) Exception handling.
(10×4=40 Marks) P.T.O.
*3100*
3100 PART – B Answer one questions from each Module. Module – I
I. a) Explain the data storage methods in a magnetic floppy disk and an optical disk. b) Explain the important features of object oriented programming.
10 10
OR II. a) Discuss the data representation inside a computer. b) Draw a flow chart to print the day of a given month in year 2007. (Given that 1-1-2007 is Monday).
10 10
Module – II III. a) Explain the concept of polymorphism. How has it been implemented in C++ ?
8
b) Write a program to add the times t1 and t2 and print their sum. The time format shall be hr : m : s. 12 OR IV. a) What is a friend function ? What are the advantage and disadvantage of declaring a friend function in C++ ?
8
b) Write a program to add two complex numbers. Use constructors and operator over loading. 12 Module – III V. a) What is the difference between early binding and late binding ?
8
b) Design and implement a matrix of size m × n. Use dynamic constructors to initialise the class. Include a member function to find the product of two matrices.
12
OR VI. a) How can you overload << function ? Explain with an example.
8
b) Write a program to read two strings from a file and concatenate them and write to another file. 12 ———————