munotes®

B.Sc. (Computer Science) Sem 2 Introduction to OOP Using C++ Apr 2024 Question Paper - Mumbai University | munotes

Introduction To OOP Using C++ Question Paper, Apr 2024.pdf
SEM 2 · 55 KB · 4 Nov 2026

Loading PDF...

Questions asked in this paper

  1. Q1 All questions are compulsory
  2. Q2 Mixing of sub questions is not allowed
  3. Q3 Write in clear, legible, writing Attempt any four: (20)
    • A) Explain bitwise operators in C++ with examples
    • B) Explain the ‘for’ loop in C++ with an examples
    • C) Explain various data types and qualifiers in C++
    • D) Write a program in C++ to print prime numbers between 2 to 100
    • E) Write a program to check if a given a number taken from the user is a palindromic number or not
    • F) Write a program in C++ to input an integer containing only Os and 1s a “binary” integer) and print its decimal equivalent. Do not use any
  4. Q2 Attempt any four: 20 marks
    • A) Explain method overloading in C++ with examples
    • B) Explain the ‘this’ keyword with examples
    • C) Write a note on friend function
    • D) Create a class represent a complex number. Define appropriate constructor. the operators for multiplying two complex numbers. Cre:ate objects in the main and demonstrate the operation
    • E) Write a program in C++ to create a class named Stock that stores the stock’s the stock’s name, the stock price for the previous day, the stock price for the current time. Define a constructor that creates a stock with the appropriate values, a method named getChangePercent() that returns, the percentage changed from stock price for the previous day to the stock price for the current time
    • F) A microwave control panel has four buttons: one for increasing the time by seconds, one for switching between power levels 1 and a reset bu.tton, and a start button. Write a program in C++ to implement a class that simulates the microwave, with a member function for each button “fhe member function for the start button should print a message “Cooking for . seconds at level .”
  5. Q3 Attempt any four: 26 marks
    • A) Write a program in C++ to implementa base class Person. Derive classes Student and Instructor from Person. A person has a name and an age. A student has a major subject, and an instructor has a salary. Write the class definitions, the constructors, and the member functions ‘display’ for all
    • B) Explain the need of virtual functions with examples
    • C) Explain with examples the order of constructor and destructor calls in
    • D) Explain how inheritance is implemented in C++ with an example
    • E) Explain how dynamic polymorphism is implemented in C++ with
    • F) Write a note on method overriding in C++
  6. Q4 Attempt any five: 15 marks
    • A) Explain the pre and post increment operators in C++ with examples
    • B) Write a note on destructor in C++ with examples,
    • C) Explain the need of pure virtual functions with
    • D) Explain how you create a pointer to an object and use it to access the class
    • E) Explain the various inheritance allowed in C++ F} Write a program in C++ to read the content ofa file and display it on the

Read from the scan above, so a character or two may differ. The scan is the original.

Issue

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.

Something wrong with this paper? Report it.

Done!
Done!