COS2614 LATEST EXAM QUESTIONS
AND CORRECT ANSWERS (VERIFIED
ANSWERS) PLUS RATIONALES 2026 Q&A
| INSTANT DOWNLOAD PDF
Core Domains
• Object-Oriented Programming Principles: Abstraction,
Encapsulation, Inheritance, Polymorphism
• C++ Programming Language: Syntax, Classes, Memory
Management, Pointers, Templates
• Qt Framework: Widgets, Signals and Slots, Event Handling, GUI
Design
• UML Class Diagrams: Relationships, Inheritance, Composition,
Aggregation
• Design Patterns: Creational, Structural, and Behavioral Patterns
• Exception Handling and File I/O in C++
• Recursion, Algorithm Analysis, and Data Structures
• Advanced C++ Features: Smart Pointers, Move Semantics, Lambda
Expressions
• Software Design Principles and SOLID Principles
Introduction
This examination assesses comprehensive knowledge and applied skills in
object-oriented programming using C++ and the Qt framework, as
prescribed by the COS2614 module at the University of South Africa.
,Candidates are expected to demonstrate proficiency in designing and
implementing object-oriented software systems, applying industry-
approved processes, and solving real-world problems within South African
and global contexts. The examination consists of multiple-choice questions
and scenario-based problems designed to test both foundational
understanding and higher-order critical thinking. Each question requires
careful analysis, application of OOP principles, and clinical decision-
making within the framework of formal software design. Success on this
examination reflects mastery of the core competencies required for
competent programming and advanced study in computer science.
SECTION ONE: QUESTIONS 1–100
Question 1
In object-oriented programming, encapsulation is achieved through:
A. Public data members and private member functions
B. Private data members and public member functions
C. Public inheritance and polymorphism
D. Abstract classes and interfaces
B. Private data members and public member functions
RATIONALE: Encapsulation bundles data and methods that operate
on that data, hiding internal details. Private data members ensure data is
accessed only through public member functions, protecting integrity.
Option A reverses access specifiers.
Question 2
Which of the following correctly describes inheritance in C++?
,A. A derived class inherits all members, including private members
B. A derived class can access private members of the base class
C. A derived class inherits public and protected members of the base
class
D. A derived class cannot override base class functions
C. A derived class inherits public and protected members of the
base class
RATIONALE: In C++, a derived class inherits public and protected
members from the base class. Private members are inherited but not
directly accessible. Option A is incorrect because private members are
not accessible.
Question 3
What is the output of the following C++ code?
cpp
class A {
public:
virtual void show() { cout << "A"; }
};
class B : public A {
public:
void show() override { cout << "B"; }
};
A* obj = new B();
obj->show();
, A. A
B. B
C. Compilation error
D. Undefined behavior
B. B
RATIONALE: The show() function is declared virtual in the base class.
Dynamic dispatch calls the overridden function in the derived class
based on the runtime type, which is B. This is a classic example of
polymorphism.
Question 4
Which principle of object-oriented programming allows a class to have
multiple methods with the same name but different parameters?
A. Inheritance
B. Encapsulation
C. Polymorphism (Overloading)
D. Abstraction
C. Polymorphism (Overloading)
RATIONALE: Function overloading is a form of compile-time
polymorphism where multiple functions share the same name but differ
in parameter types or counts. This allows the same name to represent
different behaviors based on context.
Question 5
In the Qt framework, which mechanism is used for communication
between objects?
A. Callback functions
B. Signals and slots
AND CORRECT ANSWERS (VERIFIED
ANSWERS) PLUS RATIONALES 2026 Q&A
| INSTANT DOWNLOAD PDF
Core Domains
• Object-Oriented Programming Principles: Abstraction,
Encapsulation, Inheritance, Polymorphism
• C++ Programming Language: Syntax, Classes, Memory
Management, Pointers, Templates
• Qt Framework: Widgets, Signals and Slots, Event Handling, GUI
Design
• UML Class Diagrams: Relationships, Inheritance, Composition,
Aggregation
• Design Patterns: Creational, Structural, and Behavioral Patterns
• Exception Handling and File I/O in C++
• Recursion, Algorithm Analysis, and Data Structures
• Advanced C++ Features: Smart Pointers, Move Semantics, Lambda
Expressions
• Software Design Principles and SOLID Principles
Introduction
This examination assesses comprehensive knowledge and applied skills in
object-oriented programming using C++ and the Qt framework, as
prescribed by the COS2614 module at the University of South Africa.
,Candidates are expected to demonstrate proficiency in designing and
implementing object-oriented software systems, applying industry-
approved processes, and solving real-world problems within South African
and global contexts. The examination consists of multiple-choice questions
and scenario-based problems designed to test both foundational
understanding and higher-order critical thinking. Each question requires
careful analysis, application of OOP principles, and clinical decision-
making within the framework of formal software design. Success on this
examination reflects mastery of the core competencies required for
competent programming and advanced study in computer science.
SECTION ONE: QUESTIONS 1–100
Question 1
In object-oriented programming, encapsulation is achieved through:
A. Public data members and private member functions
B. Private data members and public member functions
C. Public inheritance and polymorphism
D. Abstract classes and interfaces
B. Private data members and public member functions
RATIONALE: Encapsulation bundles data and methods that operate
on that data, hiding internal details. Private data members ensure data is
accessed only through public member functions, protecting integrity.
Option A reverses access specifiers.
Question 2
Which of the following correctly describes inheritance in C++?
,A. A derived class inherits all members, including private members
B. A derived class can access private members of the base class
C. A derived class inherits public and protected members of the base
class
D. A derived class cannot override base class functions
C. A derived class inherits public and protected members of the
base class
RATIONALE: In C++, a derived class inherits public and protected
members from the base class. Private members are inherited but not
directly accessible. Option A is incorrect because private members are
not accessible.
Question 3
What is the output of the following C++ code?
cpp
class A {
public:
virtual void show() { cout << "A"; }
};
class B : public A {
public:
void show() override { cout << "B"; }
};
A* obj = new B();
obj->show();
, A. A
B. B
C. Compilation error
D. Undefined behavior
B. B
RATIONALE: The show() function is declared virtual in the base class.
Dynamic dispatch calls the overridden function in the derived class
based on the runtime type, which is B. This is a classic example of
polymorphism.
Question 4
Which principle of object-oriented programming allows a class to have
multiple methods with the same name but different parameters?
A. Inheritance
B. Encapsulation
C. Polymorphism (Overloading)
D. Abstraction
C. Polymorphism (Overloading)
RATIONALE: Function overloading is a form of compile-time
polymorphism where multiple functions share the same name but differ
in parameter types or counts. This allows the same name to represent
different behaviors based on context.
Question 5
In the Qt framework, which mechanism is used for communication
between objects?
A. Callback functions
B. Signals and slots