END TERM EXAMINATION

Similar documents
SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

VALLIAMMAI ENGINEERING COLLEGE

Get Unique study materials from

Preface to the Second Edition Preface to the First Edition Brief Contents Introduction to C++ p. 1 A Review of Structures p.

Object Oriented Programming

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

Time : 3 hours. Full Marks : 75. Own words as far as practicable. The questions are of equal value. Answer any five questions.

PROGRAMMING IN C AND C++:

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

Interview Questions of C++

Jayaram college of Engineering and Technology, Pagalavadi. CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT

22316 Course Title : Object Oriented Programming using C++ Max. Marks : 70 Time: 3 Hrs.

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C

CHOICE BASED CREDIT SYSTEM (With effect from )

CS201 - Introduction to Programming Glossary By

Object Oriented Programming. Solved MCQs - Part 2

Absolute C++ Walter Savitch

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018)

Short Notes of CS201

Object Oriented Programming with c++ Question Bank

C++ (Non for C Programmer) (BT307) 40 Hours

JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli (An approved by AICTE and Affiliated to Anna University)

10CS36: Object Oriented Programming with C++

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET

AN OVERVIEW OF C++ 1

STRUCTURING OF PROGRAM

Object Oriented Programming 2012

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

KLiC C++ Programming. (KLiC Certificate in C++ Programming)

CS201 Latest Solved MCQs

M.C.A DEGREE EXAMINATION,NOVEMBER/DECEMBER 2010 Second Semester MC 9222-OBJECT ORIENTED PROGRAMMING (Regulation 2009)

CS304 Object Oriented Programming Final Term

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

Chapter 15 - C++ As A "Better C"

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY OBJECT ORIENTED PROGRAMMING QUESTION BANK UNIT I 2 MARKS

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

DE122/DC106 Object Oriented Programming with C++ DEC 2014

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Instantiation of Template class

S Y B Voc Software Development Syllabus

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE1303. B.Tech. Year - II

C++ Important Questions with Answers

Object-Oriented Design (OOD) and C++

An Object Oriented Programming with C

XII- COMPUTER SCIENCE VOL-II MODEL TEST I

C++ for System Developers with Design Pattern

CS201 Some Important Definitions

The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions.

Problem Solving with C++

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Reg. No. : Question Paper Code : 27157

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli

COMS W3101 Programming Language: C++ (Fall 2016) Ramana Isukapalli

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli

CGS 2405 Advanced Programming with C++ Course Justification

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

CS3157: Advanced Programming. Outline

Introduction to Programming Using Java (98-388)

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING

SAURASHTRA UNIVERSITY

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

MaanavaN.Com CS1203 OBJECT ORIENTED PROGRAMMING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

PROGRAMMING IN C++ (Regulation 2008) Answer ALL questions PART A (10 2 = 20 Marks) PART B (5 16 = 80 Marks) function? (8)

Introduction to C++ Systems Programming

Tokens, Expressions and Control Structures

Data Structures using OOP C++ Lecture 3

Fast Introduction to Object Oriented Programming and C++

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a.

C++_ MARKS 40 MIN

Question 1 Consider the following structure used to keep employee records:

Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of. MCA III SEM Session -2010

University of Swaziland Department OfComputer Science Main Examination December 2016

Object oriented programming. Encapsulation. Polymorphism. Inheritance OOP

Object-Oriented Programming

COEN244: Class & function templates

INHERITANCE: EXTENDING CLASSES

CS304 Object Oriented Programming


What are the characteristics of Object Oriented programming language?

EL2310 Scientific Programming

Syllabus of C++ Software for Hands-on Learning: This course offers the following modules: Module 1: Getting Started with C++ Programming

Computer Science (330)

Object Oriented Programming(OOP).

Darshan Institute of Engineering & Technology for Diploma Studies

Time: 3 HOURS Maximum Marks: 100

CS105 C++ Lecture 7. More on Classes, Inheritance

OBJECT ORIENTED DATA STRUCTURE & ALGORITHMS

COIMBATORE EDUCATIONAL DISTRICT

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

cs3157: c++ lecture #2 (mon-11-apr-2005) chronology of some programming languages... C++ vs Java identifiers.

CS201- Introduction to Programming Current Quizzes

Object Oriented Paradigm

CERTIFICATE IN WEB PROGRAMMING

CS/B.TECH/CSE(OLD)/SEM-6/CS-605/2012 OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Transcription:

END TERM EXAMINATION THIRD SEMESTER [BCA] DECEMBER 2007 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt all questions. Internal choice is indicated. Q1 (a) What is Polymorphism? Give one example to explain it. (b) Give two differences between procedural and object oriented programming languages. (c) How garbage collection does take place in C++? Illustrate through an example. (d) What is the size of an empty class? (e) Differentiate between public and protected using a suitable example. (f) Give code for a template and explain its functionality. (g) How can we access the private Data Members through friend functions? (h) Define a generic class. Give two examples. (i) Differentiate between multiple and multilevel inheritance. Give diagrams to explain the differences. (j) What is debugging? Why is it required? (2.5X10=25) Q2 (a) Write short notes on: (3X2) (i) Abstraction (ii) Function prototype. (b) Illustrate the overloading of NEW and DELETE operator. (6.5) Write C++ program to show dynamic memory allocation. Also explain the concept. (6.5) (a) Write short notes on: (6) (i) Nested Classes (ii) Functional and Data decomposition. Q3 (a) Create a class named employee. Allow multiple constructors in the class. Create methods to generate salary and sales report of each employee using these constructors. The program should run and also display the details of at least 25 employees. (6.5) (b) Explain the concept of abstract classes. Give a program to explain this concept. (6) (a) Write short notes on: (3X2) (i) Encapsulation (ii) Default arguments and how it is used in function call. (b) Create a class called student. Include member function like enter-stud-details() and display() to input details and hence display details of at least 100 students from console. The program should use concept of dynamic memory allocation. (6.5) Q4 (a) Write short notes on: (6) (i) Classification Vs. Composition hierarchy (ii) Parametric polymorphism b) Write a C++ program to overload an operator to concatenate 2 strings. (6.5) (a) Explain aggregation and hybrid inheritance with suitable examples. (6) (b) Give C++ program to show the usage of private, public and protected. (6.5) Q5 (a) Write short notes on: (3X2=6) (i) Persistent objects (ii) Streams and its types b) Give a C++ program to explain the concept of exception handling. (6.5)

(a) Explain namespaces and overriding inheritance with examples. (6) (b) Write a C++ program to transfer text from file 1 to file 2. These files have first to be created by the user only. (6.5)

END TERM EXAMINATION THIRD SEMESTER [BCA] DECEMBER 2008 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt all questions. Internal choice is indicated. Q1 (a) Give five main advantages of object oriented programming. Describe each advantage by giving a suitable example. (b) Describe the usage of const in C++. (c) Give an example of a generic class. Explain it. (d) What is the difference between a default constructor and a copy constructor? (e) How are virtual functions implemented in C++? (f) What is multiple inheritance? What are its advantages and disadvantages? (g) Why should inline functions be used instead of plain old # define macros? (h) Give an example in the form of code to explain the use of templates. (i) Why is debugging required? Give suitable examples to justify it. (j) What is exception handling? What are its uses? (2.5X10=25) Q2 (a) Write a C++ program to show the concept of inheritance. (4.5) (b) Write short notes on: (4x2=8) (i) Information Hiding (ii) Abstraction (with suitable examples/program) (a) What is polymorphism? How can run time polymorphism be implemented? How is late binding related to it? Give suitable examples. (6.5) (b) Give short notes on: (3x2=6) (i) Dynamic memory allocation (ii) Functional Decomposition Q3 Q4 (a) Create a class called student. Allow multiple constructors in the class, include methods to generate report-card of marks obtained in 5 subjects. The program should run and display the results for at least 20 students. The program should use the concept of dynamic memory allocation. (6.5) b) Give short notes on garbage collection in C++. (3) c) How do we allocate multidimensional array using new? (3) (a) Write a program in C++ to show the concept of metaclass. (4) (b) How are C++ objects laid out in memory? (4) (c) Can a programmer free() pointers allocated with new? Can he delete pointers allocated with malloc()? Explain. (4.5) (a) write short notes on: (i) Method and Parametric Polymorphism. (ii) Differences between overloading and overriding. (c) Write a class linked queries in C++. This class should have functions for adding or deleting an item from the queue after necessary checks. The linked queue is not to be implemented using arrays. (6.5) (a) Give difference between composition and classification hierarchy using suitable code.(3) (b) Give a code in C++ to show the concept of operator overloading. (6.5)

(c) Name three operators that cannot be overloaded. Give their symbols in C++ also. (3) Q5 (a) Write a generic swap macro in C. A macro which can swap any type of data (int, char, float, struct etc.) (5) (b) Write short notes on: (2.5x3=7.5) (i) Namespaces and their advantages. (ii) Difference between multilevel and multiple inheritance. (iii)persistant objects. (a) Write a program in C++ to show the concept of exception handling. How do we change the string length of an array of char to prevent memory leaks even if someone throws an exception? (6.5) (b) Write short notes on: (2x3=6) (i) File open() and close() syntax. (ii) Stream and its types. (iii) Utility of generic class.

END TERM EXAMINATION THIRD SEMESTER [BCA] DECEMBER 2009 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt all questions. Internal choice is indicated. Q1 (a) What is the purpose of the copy constructor? (2.5) (b) Differentiate between the compile-time binding and run-time binding. (2.5) (c) Consider the definition of the following function templates: (3) Template<class X> X wow (X x,xy) {return x+y;} Find and explain the output of the following statements: (i) Cout<<wow (5,7) <<endl; (ii) String s1= sunny ; string s2= day ; cout<<wow(s1,s2)<<endl; (d) Write a recursive function to multiply two positive integers using m and n using repeated additions. (4) (e) List differences between virtual classes and virtual functions. (3) (f) What are namespaces? What are their advantages? (3) (g) What are virtual destructors? Explain and give the suitable examples. (3) (h) List differences between free()/delete() pair and malloc()/ calloc() pair. (4) Q2 Attempt any one part of the following: (a) (i) What are abstract classes? Explain their advantages. How are they created? Show by suitable examples. (3) (ii)how does the const differ in C++ from C? (3) (iii) Explain the volatile keyword of C++ with suitable example. (2) (iv) Explain the initialization list method for initialization of classdata members through the constructors. (4.5) (b) Create a String class to create empty strings or create strings from other strings passed as argument to its constructor. Memory allocation for creation and disposal of strings will be dynamic. The string class will have one char pointer to point the string and member length to hold the length of this string. Write the- (12.5) (i) Constructor and destructors for this class. (ii) Overload the + operator to find the concatenation of strins s1 and s2 into string s3 by the statement s3=s1+s2. (iii) Overload the operator < to compare two strings in the statement: if (s1<s2) (iv) Show() method to print the strings right aligned on the screen. Q3 Attempt any one part of the following: (a) (i) Differentiate between aggregation and composition with suitable examples. (3) (ii) write down the syntax for defining a member function outside the class specification. How these functions can be made inline? (3) (iii) Discuss the method and syntax for calling constructors of base classes in multilevel inheritances with suitable example. Take at least two levels of inheritance. (6.5)

(b) Create a matrix class to: (12.5) (i) Dynamically create a matrix of order mxn. (ii) To read the elements into it through the keyboards. (iii) To multiply two matrices of orders mxn and nxp. (iv) To initialize one matrix from another matrix using the copy constructor. (v) To delete a matrix explicitly using the destructor. (vi) To print a matrix on the display. Q4 Q5 Attempt any one part of the following: (a) (i) Discuss methods to overload the unary, pre-increment++ and post increment++ operators. (4.5) (ii) Explain the nested classes with suitable example. (4) (iii) What is this pointer? What happens on the execution of the statement: delete this; in a class. Write a program demonstrating the use of this pointer. (4) (b) (i) Discuss the ways to convert one object into another object. (3) (ii) Design classes called polar and rectangle for representing a point in polar and rectangle systems. Support data conversion functions to support statements such as: rectangle r1,r2; polar p1,p; r1=p1, p2=r2; (9.5) Attempt any one part of the following: (a) (i) Explain the exception handling mechanism in C++. (4.5) (ii)discuss the ostream, istream and other stream classes starting with ios class. (2.5) (iii) Write a program using class for opening text file and counting the words and lines in it. (5.5) (b) (i) Explain the persistent objects. (2) (ii) Write a generic class to sort n items into ascending order. Items are read through the keyboard. (4) (iii) Explain the working of seekg() seekp() tellp() tellg() read() write() bad() good() functions in stream classes. (6.5)

END TERM EXAMINATION THIRD SEMESTER [BCA] December 2010 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt All questions carry equal marks (15 each). Q1 (a) List the differences between function overloading and overriding. (3) (b) Differentiate between the new and malloc(). Can delete be used to free memory allocated using the malloc()? (3) (c) Explain the procedure to overload the pre-increment and post-increment operators with suitable examples. (3) (d) Write a function to return the division of two complex numbers. The real part and imaginary part could be int, float and double. (4) (e) Write the characteristics of inline functions. List the differences between inline and macros.(3) (f) What are abstract classes? Give examples. (3) (g) What are static data members? Explain and give a suitable example. (3) (h) Expalin the differences between abstraction and encapsulation. (3) Q2 (a) (i) What is structured programming? How is it different from the object oriented programming? (4.5) (ii) Write a program to calculate the roots of any quadratic equation dealing with complex roots also and printing them in appropriate form. (4) (iii) Differentiate between the run time memory management in C++ from C. (4) (b) Create a time class to perform following operations over time (hh:mm:ss) using 24 hrs. clock. (12.5) (i) To create or initialize any object of type time using constructors. (ii) To find addition of two times using operator overloading. For eg. T1=t2+t3. Or t1=27+t2; must be valid statements. In the second statement 27 seconds are added to t2. (iii) Overload the operator> to compare two times. Thus t1>t2 or t1>35 can be compared resulting the result true or false. (iv) To print the time in the format hh:mm:ss. Q3 (a) (i) How are C++ objects created using new stored in the memory? (4) (ii) Write a program to multiply two matrices. Both matrices order will be entered through keyboard and are created accordingly at run time. The matrix containing multiplication is also created at run time. Use the constructors and destructors. (8.5) (b) (i) Write a program in C++ to illustrate the concept of metaclass. (3) (ii) Give the advantages of the reference variables over the pointer variables. Under which situation they should be avoided? (3) (iii) What are the nameless objects? Why are they used in C++? (3) (iv) Discuss the ways so that a class can t be inherited by any means. (3.5) Q4 (a) (i) Name the operators and their symbols which can t be overloaded in C++? (4) (ii) Explain the nested classes with suitable example. (4) (iii) What is this pointer? What happens on the statement: delete this; in a class. Write a program demonstrating the use of this pointer. (4.5) (b) (i) What is a copy constructor? Explain with suitable example. (3)

(ii) Write a program to support the following statements over strings in C++ (9.5) 1) Int p= xyz into p. 2) S1= hello +s2; to find concatenation of hello and s2 intos1. 3) S1=-s2; to find reverse of s2 into s1. Q5 (a) (i) Explain the try/catch structure in C++ and its variants from the exception class.(4.5) (ii) Discuss the hierarchy of stream classes. (3) (iii) Write a program using class for opening text file and replacing all lowercase letters to uppercase and vice versa leaving other characters intact. (5) (b) (i) Explain the persistent objects. (2) (ii) Differentiate between the multilevel and multiple inheritances. (4) (iii)explain the syntax and working of any six file functions in system classes. (6.5)

END TERM EXAMINATION THIRD SEMESTER [BCA] DECEMBER 2011 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt all questions. Internal choice is indicated. Q 1 (a) What are the advantages of references over pointers? Also, discuss some of the advantages of pointers over references. (b) Point out the reasons why using 'new' is a better idea than using malloc(). (c) What is the size of the Empty Class? And why? Also, give an example to print the size of the empty class. (d) Design a class from which only one object can be created. If more than one object is created then the program should terminate. (e) Which are the three stream classes that commonly used for disk I/O? Also, give the names of their base classes. (f) Write a short note on Parameterized constructor. (g) Give a C++ code/program to explain the use of a static variable. (h) How can we access the private data members through friend functions? (i) How Virtual functions are implemented in C++? (j)what are Abstract classes? Explain with an example. Also, state their advantages. Q2 (a) What is the principle reason of passing arguments by reference? Explain with a C++ code. (4) (b) What is Dynamic memory allocation? How can we achieve Dynamic Memory allocation in C++? (6) (c) Write a short note on Functional Decomposition. (2.5) (a) Define a class to represent a bank account. Data members should include name_of_the_depositor, account_number, account_type, and the balance. Member functions to be included: - (8.5) (i) To assign initial values. (ii) To display account information. (iii) To deposit an amount. (iv) To withdraw an amount after checking for the balance (Whether that much amount can be withdrawn or not). Decide about public and private members on your own. (b) Predict and explain the output of the following programs: - (i) int main() { int iarr[]={l0,11,12,13,14}; int I, *p; for(p=iarr, i=0; p+i<=iarr+4; p++, i++) { cout<<*(p+i); (2x2) } cout<<"\n";

} return 0; (ii) void fun(char *name) { name= John Lennon ; } void main() { char *name="bob Dylan"; fun(name); } Q3 (a) Write a function power() to raise a number 'm' to a power 'n'. The function takes a double value for 'm' and int value for 'n' and returns the result correctly. Use a default value of 2 for 'n' to make the function to calculate squares when this argument is omitted. Write a main that gets the values of 'm' and 'n' from the user to test the function. (4) (b) List some of the special properties of constructor functions. (2.5) (c) Write short notes on the following:- (6) (i) Nested classes (ii) Function overloading v/s Function Overriding Create a class called "employee" that contains an employee number, employee name, department name and salary. Include a member function getdata() to get data from the user for insertion into object; another function putdata() to display t.he data. Use appropriate constructors. The program should input and printout data for 100 employees. Also, provide the facility of searching an employee record according to user's choice given as: - (12.5) (a) Search by employee number (b) Search by employee name. Finally display the searched record (if found). Q4 (a) List the operators which cannot be overloaded with their symbols and name. (3) (b) How assignment operator can be overloaded? Illustrate with a suitable example. (6) (c) Explain constructors in Derived classes with a suitable example. (3.5) (a) What is a 'this' pointer? What are its uses? (3) (b) Write short notes on the following: - (5) (i) Multilevel v/s Multiple Inheritance. (ii) Virtual Base Class v/s Virtual Function. (c) Write a program to implement the concept of Private Single Inheritance. (4.5) Q5 (a) Write a program using class for opening a text file and counting the words and lines in it. (5) (b) Write short notes on the following: - (2.5x3=7.5) (i) Namespaces and their advantages (ii) Stream and its types (iii) Templates

(a) Discuss Exception Handling with its mechanism. Write a program which accepts two integers from the console and throws divide by zero exception if both the values entered by the user are equal. (8) (b) Discuss different file modes available in C++ file handling. (4.5) ********