[go: up one dir, main page]

0% found this document useful (0 votes)
61 views2 pages

C++MidTermPaper October 2021

The document appears to be an exam for an Object Oriented Programming using C++ course, as it contains 6 questions about OOP concepts like constructors, encapsulation, static members, function overloading, and more. Students are instructed to answer question 1 fully and 3 of the other 5 questions. The questions cover key C++ and OOP topics to test the students' understanding of concepts like classes, objects, inheritance and polymorphism.

Uploaded by

harsh Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views2 pages

C++MidTermPaper October 2021

The document appears to be an exam for an Object Oriented Programming using C++ course, as it contains 6 questions about OOP concepts like constructors, encapsulation, static members, function overloading, and more. Students are instructed to answer question 1 fully and 3 of the other 5 questions. The questions cover key C++ and OOP topics to test the students' understanding of concepts like classes, objects, inheritance and polymorphism.

Uploaded by

harsh Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

(Please write your Enrolment No.) Enrolment No…………..………….……….

MAHARAJA SURAJMAL INSTITUTE


MID - TERM EXAMINATION
THIRD SEMESTER [BCA] Oct – 2021
Paper Code: BCA209 Subject: Object Oriented Programming using C++
Paper ID: 20209 Batch 2020-23
Time: 3.00 Hours (including objective MCQ test also)
Maximum Marks: 60 (40 for subjective + 20 for MCQ)
Note: Question one is compulsory. Attempt any three from the rest. Q.2 to Q.6 carry
10 marks each.

Q1. Attempt any 4 questions. 2.5X4 = 10


(a) Explain the different uses of const in C++.
(b) What is the difference between default and parameterized constructor?
(c) How does inline function differ from macro? Explain all differences.
(d) What do you mean by this pointer? Explain.
(e) Assume Time is a class. What is the difference between following two statements?
· Time t1(4,10,34);
· Time t1 = Time(4,10,34);
(f) What are enumeration variables? How are they declared?

Q.2 (a) Differentiate between object-oriented programming and procedure oriented


programming.
(b) Define encapsulation and prove how it allows us to achieve data hiding giving an
example code.

Q.3 (a) Explain the concept of static data member and static member function with the help of
a program.
(b) Explain the concept of function overloading. Write a program to demonstrate function
overloading for function swap( ) to swap values corresponding to different data types
using C++ code.

Q.4 (a) Create a class named employee. Allow multiple constructors in it. Create methods
to generate salary report of each employee. The program should run and also display the
details of 5 employees.
(b) Explain Reference variable with a suitable example. What is the principle reason of
passing arguments by Reference? Differentiate between passing arguments by using
pointer variables and reference variable. Explain with C++ program.
Q.5 (a) What do you mean by a friend class? Explain with suitable code.
(b) WAP to create a class Matrix to represent a 2D array to be allocated the memory
dynamically by using concept of array of array pointers. Write down a parametric
constructor that receives no. of rows and no. of columns as arguments. Write a destructor
to release a memory. Write down two member function input() and output() for elements
of the 2D Array.

Q.6 (a) Write a program to illustrate the concept of object as an argument and returning
objects.
(b) What is the difference between member function defined inside and outside the body
of a class? How is inline member function defined outside the body of a class? Explain
with example.

You might also like