100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS3711 Assignment 3 (COMPLETE ANSWERS) Semester 2025

Rating
-
Sold
-
Pages
27
Grade
A+
Uploaded on
16-09-2025
Written in
2025/2026

COS3711 Assignment 3 (COMPLETE ANSWERS) Semester 2025 - DUE 2025; 100% TRUSTED Complete, trusted solutions and explanations.











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
September 16, 2025
Number of pages
27
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

,COS3711 Assignment 3 (COMPLETE ANSWERS)
Semester 2 2025 - DUE 2025; 100% TRUSTED
Complete, trusted solutions and explanations.

I’ll give you both: (A) a clear class/UML design for the assignment and
(B) a runnable C++/Qt project skeleton (CMake) with the key classes
and glue code you’ll need. I’ll include concrete headers/implementation
skeletons you can paste into files and extend.

I won’t overload with every single UI widget line-by-line (that would be
huge), but I provide the full architecture, model classes,
thread/serialization worker, TCP client & server, and a solid
QMainWindow skeleton wired into the models — enough to compile,
run and continue building UI logic.



1) High-level design / UML (textual)

Use these design patterns:

 Factory: to create Box/Cylinder and produce the correct code
(B/C).
 Memento: backup/restore of the unallocated container list (storing
cloned container state in memory).
 Model/View: QAbstractListModel or
QStringListModel for unallocated list;
QAbstractTableModel or QStandardItemModel for
server display.
 Worker Thread: SerializationWorker (QRunnable or
QObject moved to QThread) to build XML and send to TCP
server.
 Observer / Signals: model updates notify UI.

, UML (textual):
QObject
└─ Container (abstract, QObject)
+QString code
+double weight
+int volume()
+virtual void toXml(QXmlStreamWriter&) = 0
+virtual Container* clone() const = 0

Container <- Box (QObject)
+double length, breadth, height

Container <- Cylinder (QObject)
+double diameter, height

ContainerFactory
+static Container* createBox(...)
+static Container* createCylinder(...)

Pallet (QObject)
+int number
+QList<Container*> containers
+double totalWeight()
+int totalVolume()

PalletManager (QObject)
+QMap<int, Pallet*> pallets

UnallocatedListModel : QAbstractListModel
holds QList<Container*>

Memento
+QVector<QByteArray> serializedContainers

SerializationWorker : QObject
+signals: xmlReady(QString), finished(bool)
+slots: start()

TcpClientSender : uses QTcpSocket to send XML to 127.0.0.1:6164

ServerApp (separate project)
- QTcpServer, accepts incoming XML, parse with QXmlStreamReader,
fill QStandardItemModel (display in QTreeView)

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
EstudyTube University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
489
Member since
2 year
Number of followers
176
Documents
919
Last sold
2 weeks ago

If you need further assistance or have specific questions about the content, feel free to ask!

4,0

68 reviews

5
37
4
7
3
15
2
3
1
6

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Frequently asked questions