• 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 2 out of 5 pages
Exam (elaborations)

Cos2614-Chapter 4: Lists Questions And Correct Answers Provided

Document preview thumbnail
Preview 2 out of 5 pages

COS2614-Chapter 4: Lists QUESTIONS AND CORRECT ANSWERS PROVIDED

Content preview

COS2614-Chapter 4: Lists
QUESTIONS AND CORRECT
ANSWERS PROVIDED

Question 1: Which of the following Qt classes is suitable for managing a list of strings?

a. QVector

b. QMap

c. QStringList

d. QMapIterator - ANSWER -c. QStringList



Question 2: What is the primary purpose of using QList in Qt?

a. To store a collection of key-value pairs

b. To manage a list of integers

c. To create a dynamic array of objects

d. To manage a list of objects with different data types - ANSWER -c. To create a
dynamic array of objects



Question 3: In Qt, which class should you inherit from if you want to create a custom list class
with additional functionality?

a. QList

b. QVector

c. QStringList

d. QListWidget - ANSWER -a. QList



Question 4: Which of the following statements is true about QListIterator in Qt?

a. QListIterator is used for directly modifying the elements of a QList.

, b. QListIterator is more efficient than a regular iterator for QList.

c. QListIterator allows both forward and backward traversal of a QList.

d. QListIterator is used for creating a copy of a QList. - ANSWER -c. QListIterator allows
both forward and backward traversal of a QList.



Question 5: What is the main purpose of QStringList in Qt?

a. To store a list of integers

b. To store a list of objects

c. To store a list of strings

d. To store a list of floating-point numbers - ANSWER -c. To store a list of strings



Question 6: In Qt, what is the key difference between QList and QVector?

a. QList is for storing objects, while QVector is for storing primitive data types.

b. QList provides faster random access than QVector.

c. QVector automatically resizes itself when elements are added or removed.

d. QList is a single-linked list, while QVector is a dynamic array. - ANSWER -d. QList is a
single-linked list, while QVector is a dynamic array.



Question 7: When drawing a UML class diagram, what does an aggregation relationship
between two classes represent?

a. Strong ownership, where the child class controls the lifetime of the parent class.

b. Weak ownership, where the parent class controls the lifetime of the child class.

c. A one-to-one relationship between classes.

d. A many-to-many relationship between classes. - ANSWER -a. Strong ownership,
where the child class controls the lifetime of the parent class.



Question 8: In a UML class diagram, how is a composition relationship between two classes
represented?

a. With a solid line and an arrow pointing to the parent class.

b. With a dashed line and an arrow pointing to the child class.

c. With a solid line and a diamond shape at the end pointing to the parent class.

Document information

Uploaded on
September 8, 2026
Number of pages
5
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$23.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

Sold
5
Followers
0
Items
735
Last sold
3 weeks 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