,COS3711 Assignment 2 (COMPLETE ANSWERS)
2025 - DUE 18 July 2025; 100% TRUSTED
Complete, trusted solutions and explanations.
Implement an application that tracks items bought from a store.
Screenshots of possible interfaces have been provided as
guidance below. Store application The store keeps a list of
customers so that when something is purchased from the store,
it is recorded against that customer’s name. Only the
customer’s name is required. Only two items are currently sold
in the store currently – books and magazines, and only the
name of the item is required. Clearly, a list of such items is
needed, and the user should be able to add items to the list.
When an item is added, the application should automatically
make a backup in Downloaded by Vusi Xhumalo ()
lOMoARcPSD| COS3711/Assignment 2/2025 3 memory in case
something goes wrong when the application is being used.
Provision should thus be made to restore this list when
necessary. Clearly, for the sake of data integrity, you do not
want the user to create multiple copies of these lists. When a
customer purchases items, a transaction is recorded. The
date/time of the purchase is noted, as is the name, type, and
quantity of each item purchased as part of the transaction. Use
an appropriate widget to indicate which items have already
been added as part of this transaction. All transactions should
be displayed on the main GUI. A tree model (and appropriate
,view) should be used so that a user can see a customer’s
transactions grouped together. Downloaded by Vusi Xhumalo ()
lOMoARcPSD| COS3711/Assignment 2/2025 4 The user should
be able to broadcast (using UDP) the contents of the model in
XML format. This task should be run as a thread in the main
application. The required XML format can be seen in the image
in the next section. UDP receiver application Create a separate
application that simply listens for the broadcast message and
displays the received data (in XML format) on the GUI. 3.
Requirements The following general requirements should be
noted. • Follow good OOP design principles. • You should use
menus in your application. • Pointers should be used for all
instances of objects, and memory should be properly managed.
• Appropriate design patterns should be used where sensible. 4.
Extras Bonus marks will be awarded for the following. • The
data members required for the classes are very basic and can be
extended (like adding a price for each item and tracking the
number of items available). Downloaded by Vusi Xhumalo ()
lOMoARcPSD| COS3711/Assignment 2/2025 5 • Using
QMainWindow functionality: o Splash screen o Application icon
o Toolbar o About and Help 5. Submission Please check the How
to submit the assessments page in the Module orientation
lesson on myUnisa before submitting this assignment for
information about how to submit the assignment. • Use CMake
when setting up your assignment. • Submit only the project
, folders. • You should not submit the build-desktop folders. • Zip
the two folders (for the two parts of the project) into one
zipped file for submission.
Here’s a detailed plan and implementation outline WITH REAL
CODES for your COS3711 Assignment 2 (2025) using C++ with
Qt (e.g., Qt 6). This application consists of two parts:
Key Technologies
C++ with Qt Framework
QTreeView + QStandardItemModel for displaying
transactions
QUdpSocket for broadcasting and receiving
XML handling via QDomDocument or QXmlStreamWriter
CMake for project setup
📌 Application 1: Store Application
1. Class Design Overview
cpp
CopyEdit
// Customer.h
class Customer {
public:
2025 - DUE 18 July 2025; 100% TRUSTED
Complete, trusted solutions and explanations.
Implement an application that tracks items bought from a store.
Screenshots of possible interfaces have been provided as
guidance below. Store application The store keeps a list of
customers so that when something is purchased from the store,
it is recorded against that customer’s name. Only the
customer’s name is required. Only two items are currently sold
in the store currently – books and magazines, and only the
name of the item is required. Clearly, a list of such items is
needed, and the user should be able to add items to the list.
When an item is added, the application should automatically
make a backup in Downloaded by Vusi Xhumalo ()
lOMoARcPSD| COS3711/Assignment 2/2025 3 memory in case
something goes wrong when the application is being used.
Provision should thus be made to restore this list when
necessary. Clearly, for the sake of data integrity, you do not
want the user to create multiple copies of these lists. When a
customer purchases items, a transaction is recorded. The
date/time of the purchase is noted, as is the name, type, and
quantity of each item purchased as part of the transaction. Use
an appropriate widget to indicate which items have already
been added as part of this transaction. All transactions should
be displayed on the main GUI. A tree model (and appropriate
,view) should be used so that a user can see a customer’s
transactions grouped together. Downloaded by Vusi Xhumalo ()
lOMoARcPSD| COS3711/Assignment 2/2025 4 The user should
be able to broadcast (using UDP) the contents of the model in
XML format. This task should be run as a thread in the main
application. The required XML format can be seen in the image
in the next section. UDP receiver application Create a separate
application that simply listens for the broadcast message and
displays the received data (in XML format) on the GUI. 3.
Requirements The following general requirements should be
noted. • Follow good OOP design principles. • You should use
menus in your application. • Pointers should be used for all
instances of objects, and memory should be properly managed.
• Appropriate design patterns should be used where sensible. 4.
Extras Bonus marks will be awarded for the following. • The
data members required for the classes are very basic and can be
extended (like adding a price for each item and tracking the
number of items available). Downloaded by Vusi Xhumalo ()
lOMoARcPSD| COS3711/Assignment 2/2025 5 • Using
QMainWindow functionality: o Splash screen o Application icon
o Toolbar o About and Help 5. Submission Please check the How
to submit the assessments page in the Module orientation
lesson on myUnisa before submitting this assignment for
information about how to submit the assignment. • Use CMake
when setting up your assignment. • Submit only the project
, folders. • You should not submit the build-desktop folders. • Zip
the two folders (for the two parts of the project) into one
zipped file for submission.
Here’s a detailed plan and implementation outline WITH REAL
CODES for your COS3711 Assignment 2 (2025) using C++ with
Qt (e.g., Qt 6). This application consists of two parts:
Key Technologies
C++ with Qt Framework
QTreeView + QStandardItemModel for displaying
transactions
QUdpSocket for broadcasting and receiving
XML handling via QDomDocument or QXmlStreamWriter
CMake for project setup
📌 Application 1: Store Application
1. Class Design Overview
cpp
CopyEdit
// Customer.h
class Customer {
public: