Mumbai University Solved Question Papers munotes.in
Introduction to OOP using C++
BSc CS · Sem 2
Mar 2025 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
Mar 2025 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 Mar 2025 examination.
The questions below are the paper as the University of Mumbai set it at the Mar 2025 examination, in the order it was set.
MarksPage
The questions in this volume are the questions asked at the Mar 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 · 12 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 any 2 from the following 10 Marks
Answer
For full marks, cover: the definition of a token, the five kinds with an example of each, three kinds explained in detail with their rules, and a statement split into its tokens.
A token is the smallest individual unit of a C++ program. Before the compiler can understand a statement, it cuts the statement into tokens, as a reader splits a sentence into words. Spaces, tabs, newlines and comments are not tokens; they only keep tokens apart.
C++ has five kinds of token:
| Kind | Examples |
|---|---|
| Keywords | int, class, return |
| Identifiers | scored, maxMarks, Student |
| Constants | 87, 100.0, 'A' |
| Strings | "per cent" |
| Operators | =, *, << |
The separators ;, { }, ( ) and , are called punctuators.
A keyword is a word reserved by C++ with a fixed meaning, such as int, double, char, if, while, class, public and return. Keywords are written in lowercase. A keyword cannot be used as a name: int class; does not compile.
An identifier is a name the programmer gives to a variable, function, class or object. The rules are:
_ only.marks and Marks are two different names.Valid: total_marks, _count, maxMarks. Invalid: 2ndRank (starts with a digit), roll no (has a space) and float (a keyword).
A constant, also called a literal, is a fixed value written directly in the program.
87, -5 and 0.100.0 and 3.14.'A' or '\n'.A named constant is made with const, as in const int maxMarks = 100;. Its value cannot be changed later.
#include <iostream>using namespace std;int main() { const int maxMarks = 100; int scored = 87; char grade = 'A'; double percent = scored * 100.0 / maxMarks; cout << "Grade " << grade << ", " << percent << " per cent\n"; return 0;}Output:
Grade A, 87 per cent
The statement double percent = scored * 100.0 / maxMarks; has nine tokens:
| Token | Kind |
|---|---|
double | keyword |
percent | identifier |
= | operator |
scored | identifier |
* | operator |
100.0 | constant |
/ | operator |
maxMarks | identifier |
; | punctuator |
Conclusion. A token is the smallest unit of a C++ program. The five kinds are keywords, identifiers, constants, strings and operators. Keywords are reserved words, identifiers are names that follow fixed rules, and constants are fixed values such as 87 or 'A'.
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.