100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Tentamen (uitwerkingen)

COS3711 Assignment 2 (COMPLETE ANSWERS) 2025 - DUE 18 July 2025

Beoordeling
-
Verkocht
5
Pagina's
19
Cijfer
A+
Geüpload op
16-07-2025
Geschreven in
2024/2025

COS3711 Assignment 2 (COMPLETE ANSWERS) 2025 - DUE 18 July 2025; 100% TRUSTED Complete, trusted solutions and explanations. For assistance, Whats-App 0.6.7-1.7.1-1.7.3.9. Ensure your success with us..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.

Meer zien Lees minder
Instelling
Vak








Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
16 juli 2025
Aantal pagina's
19
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

COS3711
Assignment 2 2025
Unique number:

Due Date: 18 July 2025
Project Structure Overview

You’ll need two separate folders/projects:

COS3711_Assignment2/

├── store_app/ <- Project 1: Store application
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── MainWindow.h/.cpp
│ ├── Customer.h/.cpp
│ ├── Item.h/.cpp
│ ├── Transaction.h/.cpp
│ └── ...

├── udp_receiver/ <- Project 2: UDP listener app
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── MainWindow.h/.cpp
│ └── ...



Terms of use
By making use of this document you agree to:
 Use this document as a guide for learning, comparison and reference purpose,
Terms of use
 Not to duplicate, reproduce and/or misrepresent the contents of this document as your own work,
By making use of this document you agree to:
 Use this document
Fully accept the consequences
solely as a guide forshould you plagiarise
learning, reference,or and
misuse this document.
comparison purposes,
 Ensure originality of your own work, and fully accept the consequences should you plagiarise or misuse this document.
 Comply with all relevant standards, guidelines, regulations, and legislation governing academic and written work.

Disclaimer
Great care has been taken in the preparation of this document; however, the contents are provided "as is" without any express or
implied representations or warranties. The author accepts no responsibility or liability for any actions taken based on the
information contained within this document. This document is intended solely for comparison, research, and reference purposes.
Reproduction, resale, or transmission of any part of this document, in any form or by any means, is strictly prohibited.

, +27 67 171 1739



Project Structure Overview

You’ll need two separate folders/projects:

COS3711_Assignment2/

├── store_app/ <- Project 1: Store application
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── MainWindow.h/.cpp
│ ├── Customer.h/.cpp
│ ├── Item.h/.cpp
│ ├── Transaction.h/.cpp
│ └── ...

├── udp_receiver/ <- Project 2: UDP listener app
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── MainWindow.h/.cpp
│ └── ...



1. Starter Code – store_app
✅CMakeLists.txt
cmake
CopyEdit
cmake_minimum_required(VERSION 3.5)

project(store_app)

set(CMAKE_CXX_STANDARD 17)

find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)

add_executable(store_app
main.cpp
MainWindow.cpp MainWindow.h
Customer.cpp Customer.h
Item.cpp Item.h
Transaction.cpp Transaction.h
)

target_link_libraries(store_app Qt5::Core Qt5::Widgets Qt5::Network)



✅main.cpp
cpp
CopyEdit
#include <QApplication>
#include "MainWindow.h"
Disclaimer
Great care has been taken in the preparation of this document; however, the contents are provided "as is"
without any express or implied representations or warranties. The author accepts no responsibility or
liability for any actions taken based on the information contained within this document. This document is
intended solely for comparison, research, and reference purposes. Reproduction, resale, or transmission
of any part of this document, in any form or by any means, is strictly prohibited.

, +27 67 171 1739



int main(int argc, char *argv[]) {
QApplication app(argc, argv);
MainWindow w;
w.show();
return app.exec();
}



✅MainWindow.h
cpp
CopyEdit
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTreeView>
#include <QStandardItemModel>
#include <QUdpSocket>
#include <QPushButton>

class MainWindow : public QMainWindow {
Q_OBJECT

public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();

private slots:
void onBroadcastClicked();

private:
QStandardItemModel *transactionModel;
QPushButton *broadcastButton;
void setupUI();
void populateDummyData();
};

#endif // MAINWINDOW_H



✅MainWindow.cpp
cpp
CopyEdit
#include "MainWindow.h"
#include <QVBoxLayout>
#include <QTreeView>
#include <QXmlStreamWriter>
#include <QByteArray>
#include <QThread>
#include <QUdpSocket>
#include <QPushButton>

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),
transactionModel(new QStandardItemModel(this))
{
Disclaimer
Great care has been taken in the preparation of this document; however, the contents are provided "as is"
without any express or implied representations or warranties. The author accepts no responsibility or
liability for any actions taken based on the information contained within this document. This document is
intended solely for comparison, research, and reference purposes. Reproduction, resale, or transmission
of any part of this document, in any form or by any means, is strictly prohibited.

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
EduPal University of South Africa (Unisa)
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
149163
Lid sinds
7 jaar
Aantal volgers
35995
Documenten
4310
Laatst verkocht
2 uur geleden

4,2

13554 beoordelingen

5
7802
4
2688
3
1790
2
455
1
819

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen