Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 16 pages
Exam (elaborations)

COS3711 Assignment 2 due date 18 July 2025

Document preview thumbnail
Preview 3 out of 16 pages

COS3711 Assignment 2 2025 - DUE 18 July 2025; 100% TRUSTED workings with detailed Answers for A+ Grade.

Content preview

COS3711
ASSIGNMENT 2 2025

UNIQUE NO.
DUE DATE: 18 JULY 2025

,Advanced Programming

1. Store Application Structure
Classes to Design
A. Customer
class Customer {
QString name;
QList<Transaction*> transactions;
};
B. Item
enum class ItemType { Book, Magazine };

class Item {
QString name;
ItemType type;
};
C. Transaction
class Transaction {
QDateTime dateTime;
QList<Item*> items;
QList<int> quantities; // matching index
};
D. Store
class Store {
QList<Customer*> customers;
QList<Item*> items;
QList<Item*> itemBackup;

void backupItems();
void restoreItems();
};


�GUI Features (MainWindow)

 Menus:
o File → Exit
o Customer → Add Customer
o Item → Add Item, Restore Items
o Transactions → New Transaction
o Broadcast → Send Transactions
 Toolbar:
o Quick buttons for the actions above
 Status Bar:

, o Feedback on operations (e.g., "Item added", "Transaction recorded")
 Tree View:
o QTreeView to display customers and their transactions using a
QStandardItemModel.
 Input Dialogs:
o QInputDialog for customer and item names
o QComboBox, QSpinBox in a QDialog for transactions




💾 Memory & GUI Management


 Manually create widgets using parent-child structure
 Use delete or smart pointers to manage memory (especially transactions/items)
 Use setFocus(), setTabOrder(), and manage widget states (enable/disable)
 Provide feedback via QMessageBox and status bar




2. UDP Broadcasting

 Create a QThread subclass for broadcasting
 Format all transactions as XML (QDomDocument)
 Use QUdpSocket to broadcast on a known port
 Example XML:

<store>
<customer name="John Doe">
<transaction date="2025-07-01T12:34">
<item name="Intro to Qt" type="Book" quantity="1"/>
</transaction>
</customer>
</store>



3. 📥 UDP Receiver Application

 Simple Qt GUI with a QTextEdit
 Use QUdpSocket to listen on the same port

Document information

Uploaded on
July 5, 2025
Number of pages
16
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$2.97

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
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.
StudyAidPro
3.9
(23)
Sold
194
Followers
2
Items
560
Last sold
3 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