Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

COS2614 EXAM PACK.

Beoordeling
-
Verkocht
2
Pagina's
64
Cijfer
A+
Geüpload op
06-10-2021
Geschreven in
2021/2022

COS2614 EXAM PACK. COS2614 - Programming: Contemporary Concepts. Polymorphism is the ability of something to take on multiple forms. The code in 2.7 shows how the call to ‘calculateFee’ behaves differently depending on it’s type which can either be Registration or StudentRegistration. 2.9 It could inherit from QMapint, Registration* instead, using int to store the id as the key and Registration* to store the related value. It could also make use of a QStackRegistration* container making it easy to push and pop item in the list. 2.10 Registration and Person: They have a composition relationship. It’s a one is to one type relationship where one instance of Registration can hold one instance of Person. Registration and RegistrationList: They have a composition relationship. It’s a one is to many relationship where one instance of RegistrationList can hold many instances of Registration. 2.11 a. class RegistrationList: public QMapint, Registration* 2.11 b. QList allows you to store items directly in your list whereas QMap needs them to be stored in key value form. It’s easier to search for items in a QMap because they are accessed using their key. QList needs you to iterate through the list when searching if you do not know the item’s index. Downloaded by: charlenecicero | Distribution of this document is illegal S - The study-notes marketplace Question 3 #ifndef FORTUNECOOKIE_H #define FORTUNECOOKIE_H #include QDialog class FortuneCookie: public QDialog { Q_OBJECT public: FortuneCookie(); public slots: on_button_click(); }; #endif // FORTUNECOOKIE_H #include "fortunecookie.h" #include QPushButton #include "quotefactory.h" #include QMessageBox #include QString FortuneCookie::FortuneCookie() { setFixedSize(150,50); QPushButton* btn = new QPushButton("Open a fortune cookie",this); setWindowTitle("Fortune Cookie"); connect(btn,SIGNAL(clicked(bool)),this,SLOT(on_button_click())); } FortuneCookie::on_button_click() { QuoteFactory qf; QString quote = Quote(); QMessageBox::information(0,"Message",quote); } 3.2 The child management facility is the ability of the parent container to manage the life time of its child objects. When the parent is removed from memory, it will ensure that any child pointers are deleted preventing memory leaks. 3.3 Views are classes responsible for generating the user interface. Model classes hold the data/ application logic used by the application. The benefit of this is that you can reuse application logic between applications and user interfaces. 3.4 a. MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { QMenu* menu = new QMenu("&Applications", this); QAction* action = new QAction("&FortuneCookie", this); QActionGroup* actionGroup = new QActionGroup(this); actionGroup-addAction(action); Downloaded by: charlenecicero | Distribution of this document is illegal S - The study-notes marketplace menu-addActions(actionGroup-actions()); menuBar()-addMenu(menu); QToolBar* toolbar = new QToolBar("Cookie bar",this); toolbar-addActions(actionGroup-actions()); QMainWindow::addToolBar(Qt::BottomToolBarArea, toolbar); connect(action, SIGNAL(triggered(bool)), this, SLOT(startApplication())); } 3.4 b. void MainWindow::startApplication() { FortuneCookie* fc = new FortuneCookie(); setCentralWidget(fc); } Question 4 4. 1 Design patterns are efficient and elegant solutions to common problems in object oriented software design. They are high-level abstract templates that can be applied to particular kinds of design problems. 4.2 They attempt to express similar code in an abstract way, this allows for code reuse. Design patterns also promote extensibility. A measure of how easy it is to add improvements to an application 4.3 Composite: Every QObject maintains a list of its children. You can make one QObject a child of another by calling setParent(), which automatically adds it to the list of children of its parent. Observer: The QObject class represents the application of a simplified form of the observer pattern, particularly in its implementation of signals and slots. 4.4 The implementation of implicit sharing in Qt containers applies a simplified form of the classic flyweight pattern. Although it represents a way of saving memory by sharing data that would otherwise be duplicated, there isn’t any explicit data. Examples: QString, QVariant, and QStringList. 4.5 It composes objects into tree structures to represent part-whole hierarchies. It is intended to facilitate building complex (composite) objects from simpler (component) parts representing treelike structures. 4.6 Client, Component, Leaf and Composite. Downloaded by: charlenecicero |

Meer zien Lees minder
Instelling
University Of South Africa
Vak
COS2614 - Programming: Contemporary Concepts (COS2614)











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

Geschreven voor

Instelling
University of South Africa
Vak
COS2614 - Programming: Contemporary Concepts (COS2614)

Documentinformatie

Geüpload op
6 oktober 2021
Aantal pagina's
64
Geschreven in
2021/2022
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$4.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

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.
ExcelAcademia2026 Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
2233
Lid sinds
4 jaar
Aantal volgers
1651
Documenten
9074
Laatst verkocht
1 dag geleden
EXCEL ACADEMIA TUTORS

At Excel Academia Tutoring, You will get solutions to all subjects in both assignments and major exams. Contact me for assistance. Good luck! Well-researched education materials for you. Expert in Nursing, Mathematics, Psychology, Biology etc. My Work has the Latest & Updated Exam Solutions, Study Guides and Notes (100% Verified Solutions that Guarantee Success)

3.7

377 beoordelingen

5
156
4
80
3
70
2
23
1
48

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 iDeal of creditcard en download je PDF-document meteen.

Student with book image

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

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen