AD-305 · Object Oriented Programming & Methodology/Unsolved PYQ Paper
AD-305 Object Oriented Programming and Methodology - Jun 2024 Question Paper
Under each question, How to answer lists the points an answer should cover, outlined by CampusPrep from the syllabus. Check the details against your textbook.
-
7 MarksaDescribe the various control statement with example.
How to answer
- Classification into selection (if, if-else, switch), iteration (for, while, do-while), and jump (break, continue, goto, return)
- Syntax and purpose of each statement type
- Code snippets or simple code examples for each category
-
7 MarksbDiscuss and compare run time and compile time polymorphism.
How to answer
- Definition of polymorphism and its two primary types
- Explanation of compile-time polymorphism (function overloading, operator overloading)
- Explanation of run-time polymorphism (virtual functions, function overriding)
- Comparison table based on binding time, execution speed, and mechanism
-
7 MarksaWhat is meant by abstract class?
How to answer
- Definition of abstract class (a class that cannot be instantiated directly)
- Concept of pure virtual functions ($=0$ in C++)
- Role as a base class/interface for derived classes
- Short syntax/declaration example
-
7 MarksbWhat is constructor? Is it mandatory to use constructor in a class.
How to answer
- Definition and properties of a constructor (special member function with class name, no return type)
- Types of constructors (default, parameterized, copy)
- Explanation of whether it is mandatory (not strictly mandatory to define manually, as the compiler supplies a default constructor if none is declared)
-
7 MarksaExplain public, private and protected access specifiers and show their visibility when they are inherited as public, private and protected?
How to answer
- Definitions of public, private, and protected visibility within a class
- Inheritance access table showing base class members vs derivation modes (public, protected, private)
- Explanation of accessibility of inherited members in derived classes and from objects
-
7 MarksbDefine operator overloading? Explain how to overload unary operator and binary operator?
How to answer
- Definition of operator overloading and syntax of `operator` function
- Overloading unary operator (syntax, member vs friend function, parameter rules, example like `++` or `-`)
- Overloading binary operator (syntax, parameters required, example like `+` or `==`)
-
14 MarksWrite short notes on (any two): i) Exception handling ii) New and delete iii) Polymorphism
How to answer
- Exception handling: try, catch, and throw blocks mechanism and advantages
- New and delete: Dynamic memory management in C++, allocation and deallocation of single objects and arrays
- Polymorphism: Concept of multiple forms, compile-time vs run-time mechanisms
-
7 MarksaWhat do you mean by Array Index Out of Bounds Exception and Null Pointer Exception?
How to answer
- Definition and cause of ArrayIndexOutOfBoundsException with an example index access
- Definition and cause of NullPointerException when dereferencing null references/pointers
- How these exceptions can be avoided or caught
-
7 MarksbWhat are member functions? Explain with example.
How to answer
- Definition of member functions (functions declared inside a class that operate on class data)
- Defining member functions: inside the class vs outside the class using scope resolution operator (`::`)
- Example C++ class demonstrating member function declaration, definition, and invocation
-
14 MarksWrite a program having student as an abstract class and create many derived classes such as engineering, science medical etc. from the student class. Create their objects and process them.
How to answer
- Declare abstract class `Student` with at least one pure virtual function (e.g., `virtual void process() = 0;`)
- Derive classes `Engineering`, `Science`, and `Medical`, overriding the pure virtual function
- Implement `main()` function: create objects or pointers to base class, call member methods
-
7 MarksaWrite an interactive program for manipulating object of distance class. Support member functions for adding and subtracting distance members of two objects?
How to answer
- Define `Distance` class with members (e.g., feet and inches or meters)
- Implement member functions `add(Distance)` and `subtract(Distance)` handling unit normalization
- Provide interactive user interface in `main()` to input distances, perform operations, and display results
-
7 MarksbExplain virtual function and write its purpose.
How to answer
- Definition of virtual function (member function declared with `virtual` keyword in base class)
- Purpose: Enabling dynamic/late binding and achieving run-time polymorphism
- Mechanism: Brief mention of vtable and vptr
-
14 MarksWrite short notes on (any two): a) Access modifiers b) Abstract base classes c) Association
How to answer
- Access modifiers: public, private, protected keywords restricting scope/visibility of class members
- Abstract base classes: Base classes designed for inheritance containing pure virtual methods
- Association: Relationship between two independent classes representing a 'has-a' or 'uses-a' connection without ownership
Go to where you left off?
Quick Add to Notes
Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.
Create free accountHave an account? Log in
Notes Panel