Mumbai University Solved Question Papers munotes.in
Object Oriented Programming using C++
BSc IT · Sem II
Apr 2025 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
Mumbai University Solved Question Papers munotes.in
Object Oriented Programming using C++
BSc IT · Sem II
Apr 2025 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
First published on munotes.in on 12 November 2026.
Published by munotes.in, Mumbai.
Model answers written and edited by the munotes.in editorial desk.
Passages from this volume may be quoted, in print, online or by an AI system, with credit: name munotes.in and link to this volume's page. The volume may not be reproduced as a whole. Full terms at munotes.in/content-license.
munotes.in is an independent study resource for students of the University of Mumbai. It is not affiliated with the University of Mumbai, and is not endorsed by it.
The University does not publish an official answer key for this paper. The answers in this volume are model answers, written to show how a full-mark answer is built. They are a study aid, not an authority on what an examiner marked.
The question paper reproduced here is the paper as set by the University of Mumbai at the Apr 2025 examination.
The questions below are the paper as the University of Mumbai set it at the Apr 2025 examination, in the order it was set.
MarksPage
The questions in this volume are the questions asked at the Apr 2025 examination, reproduced as the University of Mumbai set them, in the order it set them. Nothing has been reworded, added or left out. Only the answers are ours. See the original question paper.
Duration 1 hours · Total marks 30 · 8 questions answered
How to use this volume
Solve the paper first, under exam conditions and against the clock. Then read the answers here and mark your own. Reading a solution before attempting the question feels productive and teaches very little, because recognising an answer is not the same as being able to write one.
Q1)
Attempt any two · 15 Marks
Answer
For full marks, cover: what a constructor is, the purposes it serves, its rules, the default, parameterized and copy constructors each with an example, constructor overloading and default arguments, and one program that uses all three types with its output.
A constructor is a special member function of a class. It has the same name as the class and no return type. It runs automatically each time an object of the class is created.
Rectangle r2(6, 4); creates and fills the object in one statement, instead of several set calls.1. Default constructor. It takes no arguments. It runs for a declaration such as Rectangle r1;. If a class has no constructor at all, the compiler supplies one that does nothing.
2. Parameterized constructor. It takes arguments, so each object can start with its own values. Rectangle r2(6, 4); passes 6 and 4.
3. Copy constructor. It creates a new object as a copy of an existing object of the same class. Its parameter is a reference to that class, usually const: Rectangle(const Rectangle &r). It runs for Rectangle r3 = r2; and when an object is passed to a function by value. The parameter must be a reference; passing by value would need a copy to make the copy.
#include <iostream>
using namespace std;
class Rectangle
{
private:
int length, breadth;
public:
Rectangle()
{
length = 1;
breadth = 1;
cout << "Default constructor" << endl;
}
Rectangle(int l, int b)
{
length = l;
breadth = b;
cout << "Parameterized constructor" << endl;
}
Rectangle(const Rectangle &r)
{
length = r.length;
breadth = r.breadth;
cout << "Copy constructor" << endl;
}
int area() { return length * breadth; }
};
int main()
{
Rectangle r1;
Rectangle r2(6, 4);
Rectangle r3 = r2;
cout << "Areas: " << r1.area() << ", " << r2.area() << ", " << r3.area() << endl;
return 0;
}
Output:
Default constructor
Parameterized constructor
Copy constructor
Areas: 1, 24, 24
r1 gets 1 x 1 from the default constructor. r2 gets 6 x 4. r3 is made from r2 by the copy constructor, so it has the same area, 24.
Having several constructors with different parameter lists in one class, as Rectangle has, is constructor overloading. The compiler picks the one whose parameters match the arguments. A constructor can also have default arguments: Rectangle(int l = 1, int b = 1) serves for Rectangle r;, Rectangle r(5); and Rectangle r(5, 2);. It must then be the only constructor that can be called with no arguments, or the call becomes ambiguous.
| Type | Parameters | Called by | Example |
|---|---|---|---|
| Default | none | Rectangle r1; | sets 1 x 1 |
| Parameterized | values for the members | Rectangle r2(6, 4); | sets 6 x 4 |
| Copy | a reference to an object of the class | Rectangle r3 = r2; | copies r2 |
Conclusion. A constructor initialises an object automatically when it is created, so the object is valid from the start. C++ has the default constructor (no arguments), the parameterized constructor (values passed in) and the copy constructor (a reference to an existing object). A class can overload them, as Rectangle does.
The rest of the answers
You have read the question paper and its first answer in full. Buy the solved papers once and you can read every answer of every solved paper in this semester.
Notes + practical solutions + solved papers: ₹798 Already bought it? Sign in
Or solved papers only: ₹499
Or notes + practical solutions: ₹499
The question paper itself stays free, and so does the syllabus.
What do you need?
Tap one.
The answers are on this page
You can read the first answer here. The box further down shows how to read all of them.
Read it here, any time
We keep checking and updating our papers and notes, and adding more. A saved copy would be an old version. Reading on munotes.in always gives you the latest one.
I paid, but I can't open it
Please type an email, or a 10-digit phone number.
Done
If we find your payment, we send a link to the email you paid with. Open it to read.
Check your email in 2 minutes. Also check Spam.
No email after 10 minutes?
Something else
Please write a little more, so we can help.
Your email app opens with this. You can add more there. We reply by email.
Found an error in this volume? Report it and we will check it against the paper.