AD-305 · Object Oriented Programming & Methodology/Unsolved PYQ Paper
AD-305 Object Oriented Programming and Methodology - Jun 2023 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 MarksaExplain the characteristics of Object-Oriented Programming and Procedural Programming in brief.
How to answer
- Key characteristics of Procedural Programming (top-down approach, focus on functions/procedures, free movement of data)
- Key characteristics of Object-Oriented Programming (bottom-up approach, focus on data encapsulation, objects, inheritance, polymorphism)
- Tabular comparison summarizing key differences
-
7 MarksbDescribe in detail the features of object-oriented paradigm.
How to answer
- Classes and Objects concepts
- Encapsulation and Data Hiding
- Abstraction
- Inheritance
- Polymorphism and Dynamic Binding
- Message Passing
-
7 MarksaWhat is meant by abstract class?
How to answer
- Definition of abstract class (cannot be instantiated)
- Explanation of pure virtual functions / abstract methods
- Role as a base class or interface blueprint
- Brief example syntax
-
7 MarksbWhat is constructor? Is it mandatory to use constructor in a class.
How to answer
- Definition of constructor (special member function with same name as class)
- Key characteristics (no return type, called automatically during instantiation)
- Whether it is mandatory: No, the compiler provides a default constructor if none is defined
- Types of constructors
-
7 MarksaExplain the fundamental concept behind inheritance in object-oriented programming by taking an example. Define multiple, multilevel and hybrid inheritance with diagram and syntax.
How to answer
- Concept of inheritance (code reusability, base and derived classes, 'is-a' relationship) with an example
- Multiple inheritance: definition, class diagram, and syntax
- Multilevel inheritance: definition, class diagram, and syntax
- Hybrid inheritance: definition, class diagram, syntax, and diamond problem overview
-
7 MarksbExplain the concept of association an aggregation in object-oriented approach. What is and Abstract class? Why Abstract classes are used?
How to answer
- Explain Association ('has-a' or 'uses-a' relationship between independent classes)
- Explain Aggregation (weak form of association, 'part-of' relationship with independent lifecycles)
- Define Abstract class
- Reasons for using Abstract classes (defining common interface, enforcing method overriding, design template)
-
7 MarksaCreate a class called cake with attributes height, weight, shape and message with a default constructor. Overload the constructor with arguments. Create methods to display details and increase the height by 2 cms and weight by 0.5 kg. finally display the details again.
How to answer
- Class definition with data members: height, weight, shape, message
- Default constructor setting default values
- Parameterized (overloaded) constructor initializing members with given arguments
- Member method to display object attributes
- Member method to increase height by 2 and weight by 0.5
- Main function creating an object, calling display, incrementing values, and displaying updated details
-
7 MarksbHow polymorphism is achieved at compile time and run time?
How to answer
- Definition of compile-time (static) polymorphism achieved via function overloading and operator overloading
- Definition of run-time (dynamic) polymorphism achieved via virtual functions and method overriding
- Mechanism of virtual tables (vtable) and virtual table pointers (vptr)
- Code snippets illustrating both types
-
7 MarksaWhat is meant by exceptions? How exception is handled?
How to answer
- Definition of exception (runtime anomaly disrupting normal program flow)
- Exception handling mechanism: try, catch, throw blocks (and finally/throws if Java)
- Flow of control during exception generation and handling
- Basic syntax / code example
-
7 MarksbExplain ATM system using object-oriented diagram.
How to answer
- Identification of classes: Bank, ATM, Customer, Account, Card, Transaction
- UML class diagram showing attributes, methods, and relationships (association, aggregation)
- Explanation of key interactions (Authenticate, Check Balance, Withdraw, Deposit)
- Brief use-case or sequence explanation
-
7 MarksaWhat do you mean by Array Index Out of Bounds Exception and Null Pointer Exception?
How to answer
- ArrayIndexOutOfBoundsException: occurs when accessing an illegal index (< 0 or >= array size); code example
- NullPointerException: occurs when attempting to access members or invoke methods on a null reference; code example
- Prevention techniques (boundary checking, null check)
-
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)
- Inside-class vs. outside-class definition (using scope resolution operator ::)
- Access specifiers (public, private, protected) regarding member functions
- Complete code example declaring, defining, and invoking a member function
-
7 MarksaHow message passing is possible in JAVA? Give example.
How to answer
- Concept of message passing in OOP (communication between objects)
- How it is realized in Java: object.methodName(parameters)
- Components: sender object, receiver object, message (method name and arguments)
- Illustrative Java code example demonstrating method call between two objects
-
7 MarksbGive example of multiple object declaration, variable declarations and constant declaration.
How to answer
- Syntax and examples for declaring multiple objects of a class simultaneously
- Syntax and examples for variable declarations (primitive and reference types)
- Syntax and examples for constant declaration (using const in C++ or final in Java)
-
14 MarksWrite short notes on (any two):
- a)Association
- b)Access modifiers
- c)Abstract base classes
How to answer
- Association: definition, types (uni/bidirectional), UML representation, code example
- Access modifiers: public, private, protected (and default), visibility and security table
- Abstract base classes: definition, purpose, pure virtual functions, derived implementation requirements
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