Mumbai University Solved Question Papers munotes.in
Introduction to OOP using C++
BSc CS · Sem 2
2022-23 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
Mumbai University Solved Question Papers munotes.in
Introduction to OOP using C++
BSc CS · Sem 2
2022-23 Examination
Previous Year Question Paper with Solution
munotes.in Mumbai
First published on munotes.in on 12 November 2026.
This edition revised 13 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 2022-23 examination.
The questions below are the paper as the University of Mumbai set it at the 2022-23 examination, in the order it was set.
MarksPage
MarksPage
The questions in this volume are the questions asked at the 2022-23 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 2½ hours · Total marks 75 · 24 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.
Q.1 Attempt the following
Any four · [20Marks]
Answer
For full marks, cover: what object oriented programming is; its characteristics, each with its meaning and its C++ form; one program that shows them together.
Object oriented programming (OOP) builds a program from objects. Each object joins data with the functions that work on that data. C++ supports OOP through classes. The main characteristics are these.
private can be changed only through the class's own functions, so it is protected from misuse. This protection is called data hiding.a.deposit(500) without knowing how the balance is stored.virtual function.a.deposit(500) is a message to object a.#include <iostream>#include <string>using namespace std;class Account { string owner; double balance;public: Account(string o, double b) : owner(o), balance(b) {} virtual ~Account() {} void deposit(double amount) { if (amount > 0) balance += amount; } string getOwner() const { return owner; } double getBalance() const { return balance; } virtual double interest() const { return balance * 0.03; }};class Savings : public Account {public: Savings(string o, double b) : Account(o, b) {} double interest() const override { return getBalance() * 0.04; }};int main() { Account a("Asha", 10000); Savings s("Ravi", 10000); a.deposit(500); a.deposit(-300); Account* all[] = {&a, &s}; for (Account* p : all) cout << p->getOwner() << ": balance " << p->getBalance() << ", interest " << p->interest() << "\n"; return 0;}Output:
Asha: balance 10500, interest 315Ravi: balance 10000, interest 400
main cannot write a.balance = 0. That is encapsulation.Savings inherit everything in Account, and line 21 gives it its own interest rate.a.interest() through an Account*. Because line 16 is virtual, Ravi's savings account earns 4 per cent, Rs 400. That is polymorphism by dynamic binding.Conclusion. The characteristics of OOP are objects, classes, encapsulation, data abstraction, inheritance, polymorphism, dynamic binding and message passing. A C++ class with private data, a derived class and a virtual function shows all of them.
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 should we fix or add?
Found an error in this volume? Report it and we will check it against the paper.