• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 4 pages
Exam (elaborations)

COS3711 Practice Questions & WELL VERIFIED Answers 1. What is reflective programming? Answer: Reflective programming is the ability of a program to inspect and/or modify its own structure and behaviour at runtime. In Qt/C++, the meta-object system p

Document preview thumbnail
Preview 1 out of 4 pages

COS3711 Practice Questions & WELL VERIFIED Answers 1. What is reflective programming? Answer: Reflective programming is the ability of a program to inspect and/or modify its own structure and behaviour at runtime. In Qt/C++, the meta-object system provides facilities such as properties, signals, slots and runtime type information. 2. What is a pure virtual function in C++? Answer: A pure virtual function is declared using = 0, for example: virtual void draw() = 0; A class containing a pure virtual function becomes an abstract class and normally cannot be instantiated directly. 3. What is inheritance? Answer: Inheritance allows a derived class to acquire and extend properties and behaviour from a base class. 4. What is polymorphism? Answer: Polymorphism allows the same interface to represent different underlying implementations. With virtual functions, a base-class pointer/reference can invoke the appropriate derived-class implementation at runtime. 5. What is the purpose of a virtual destructor? Answer: It ensures that when an object of a derived class is deleted throug

Content preview

COS3711 Practice Questions & WELL VERIFIED Answers

1. What is reflective programming?
Answer: Reflective programming is the ability of a program to inspect and/or modify its own
structure and behaviour at runtime. In Qt/C++, the meta-object system provides facilities such as
properties, signals, slots and runtime type information.

2. What is a pure virtual function in C++?
Answer: A pure virtual function is declared using = 0, for example:

virtual void draw() = 0;

A class containing a pure virtual function becomes an abstract class and normally cannot be
instantiated directly.

3. What is inheritance?
Answer: Inheritance allows a derived class to acquire and extend properties and behaviour from
a base class.

4. What is polymorphism?
Answer: Polymorphism allows the same interface to represent different underlying
implementations. With virtual functions, a base-class pointer/reference can invoke the
appropriate derived-class implementation at runtime.

5. What is the purpose of a virtual destructor?
Answer: It ensures that when an object of a derived class is deleted through a base-class pointer,
the derived-class destructor is also called.

class Shape {
public:
virtual ~Shape() {}
};

6. What is the Singleton design pattern?
Answer: Singleton restricts a class to one instance and provides a controlled way of accessing
that instance.

Typical Qt/C++ structure:

class Logger {
private:
Logger() {}

public:
static Logger& getInstance() {
static Logger instance;
return instance;
}
};

Document information

Uploaded on
September 11, 2026
Number of pages
4
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$35.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
greybrii01
5.0
(1)
Sold
1
Followers
0
Items
1151
Last sold
2 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions