B.Sc. (Computer Science) Sem 2 Introduction to OOP Using C++ Mar 2026 Question Paper - Mumbai University | munotes
Get access to whole semester resourcesSemester Pass
MU B.Sc. (Computer Science) student group
Free to join
Loading PDF...
Older exam
Apr 2025
Semester-end · Introduction to OOP using C++
→
Newer exam
None yet: this is the latest
New papers land after each exam season.
Questions asked in this paper
-
Q1 Attempt any two 10 marks
- A) Design a class named 'Stock' that contains: a data field named symbol for the stock's symbol, a data field named name for the stock's name, a data field named 'previousClosingPrice' that stores the stock price for the previous day, a data field named 'currentPrice' that stores the stock price for the current time, a constructor that creates a stock with the specified symbol, name, previous closing price and the current price. The class has a method named 'getChangePercent()' that returns the percentage changed from 'previousClosingPrice' to 'currentPrice'.
- B) Explain 4 arithmetic operators in C++ with examples.
- C) Explain friend function with example.
- D) Explain how to create array in C++ using the modern approach (array).
-
Q2 Attempt any two 10 marks
- A) Write a program in C++ to create a class Solid. The class contains a method 'volume' without a body. Create classes Sphere and Cube which inherit 'Solid'. Create objects of the two classes Sphere and Cube in main and call their 'volume' method which returns the volume of respective solids. Use polymorphism to call the methods.
- B) In 1843, Sir William Hamilton discovered an extension to complex numbers called quaternions. A quaternion is a 4-tuple a = (a0, a1, a2, a3) with the following operation: Product: a * b = (a0*b0-a1*b1-a2*b2-a3*b3, a0*b1-a1*b0+a2*b3-a3*b2, a0*b2-a1*b3+a2*b0+a3*b1, a0*b3+a1*b2-a2*b1+a3*b0) [As printed. In Hamilton's product the second component is a0*b1+a1*b0+a2*b3-a3*b2; the other three components match.] Create a class 'Quaternion' for quaternions. Define appropriate constructor and overload the operator for product. Create a test client that exercises all of your code.
- C) Explain the various types of inheritance in C++ with examples.
- D) Explain how a file is opened for reading in C++ with an example.
-
Q3 Attempt any two 10 marks
- A) Explain function overloading in C++ with examples.
- B) Explain pure virtual functions in C++ with examples.
- C) In 1843, Sir William Hamilton discovered an extension to complex numbers called quaternions. A quaternion is a 4-tuple a = (a0, a1, a2, a3) with the following operations: Sum: a + b = (a0 + b0, a1 + b1, a2 + b2, a3 + b3) Create a class 'Quaternion' for quaternions. Define appropriate constructor and overload the operator for sum. Create a test client that exercises all of your code.
- D) Write a program in C++ to create a class 'Triangle' to model a triangle shape. It has variables to store the sides of triangle. Define methods to return the area of the triangle. Write a driver program for the above.
Read from the scan above, so a character or two may differ. The scan is the original.
Something wrong on this page? Report it and we will check it against the scan.
Quick Help
No. The full paper opens straight away, with no login and nothing to pay.
Related Resources
Something wrong with this paper? Report it.
Connected Papers
B.Sc. (Computer Science) / Sem 2 · 51 papers
Questions? Email contact@munotes.in
Done!