This document contains instructions and questions for a class test on Object Oriented Programming. It includes 3 questions, each with multiple parts. Question 1 has 2 parts worth 1 mark each on the functions of eof() and good(), and the use of the -> operator with an example. Question 2 has 2 parts worth 2 marks each on using 'this' pointer with code and explaining 4 file opening modes. It also has a part worth 2 marks explaining and giving examples of 2 manipulators. Question 3 has 3 parts worth 4 marks each, on copying contents from one file to another, differentiating static and dynamic binding, and finding the length of a string using a pointer to string.
This document contains instructions and questions for a class test on Object Oriented Programming. It includes 3 questions, each with multiple parts. Question 1 has 2 parts worth 1 mark each on the functions of eof() and good(), and the use of the -> operator with an example. Question 2 has 2 parts worth 2 marks each on using 'this' pointer with code and explaining 4 file opening modes. It also has a part worth 2 marks explaining and giving examples of 2 manipulators. Question 3 has 3 parts worth 4 marks each, on copying contents from one file to another, differentiating static and dynamic binding, and finding the length of a string using a pointer to string.
Department of Information Technology & Computer Technology MSBTE Class Test – II, October – 2008 Semester :- Third Master : ‘C’ Course :- IF / CM Subject :- Object Oriented Programming (OOP) Subject Code :- 9036 Duration :- 1 Hour Max. Marks :- 20 = = = = = = = = = = = = = Instructions to candidate:- 1) All questions are compulsory. 2) Illustrate your answers with neat sketches/flowcharts wherever necessary. 3) Use of Non-programmable Electronics Calculator is permissible. 4) Figures to the right indicate full marks of respective questions. 5) Assume suitable additional data, if necessary.
Q.1 Attempt any Two. (2 × 2) 04
a) What is the function performed by eof( ) and good( )? [1M each] b) State the use of -> operator. Give appropriate example. [Use-1M, Ex-1M] c) Define pure virtual function with an example. [Define-1M, Ex-1M]
Q.2 Attempt any Two. (2 × 4) 08
a) Illustrate the use of ‘this’ pointer with suitable program code. [Explanation- 02M, Program- 02M] b) Explain following file opening modes in detail. [1M Each] i. ios::app ii. ios::out iii. ios::in iv. ios::ate c) Explain use of following manipulators with suitable examples. [Use- 1M each, Example- 1M Each] i. setiosflags( ) ii. setfill( )
Q.3 Attempt any Two. (2 × 4) 08
a) Write a program to copy contents a file “first.bin” into another file named “second.bin”. b) Differentiate between static binding and dynamic binding [4Points – 4M] c) Write the program to find length of a string using pointer to string.