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 2 out of 11 pages
Exam (elaborations)

COS3711 Assignment 4 Advanced Programming Year Module, 2026

Document preview thumbnail
Preview 2 out of 11 pages

This assignment has been carefully put together to give you more than just answers; it walks you through the reasoning behind each one, so you actually understand the material rather than just memorising it. Every solution has been verified for accuracy, with academic references that hold up to scrutiny. Whether you're working through it the night before a submission or using it to reinforce your understanding over time, it's built to be genuinely useful. The explanations are clear without being condescending, and the structure follows what examiners actually look for not just what sounds impressive. If you put in the effort to engage with it properly, distinction-level results are well within reach.

Content preview

UNIVERSITY OF SOUTH AFRICA
College of Science, Engineering and Technology


⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄


COS3711: Advanced Programming

Assignment 4 | Year Module, 2026

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄




COS3711
Module Code:
Advanced Programming
Module Name:
Rainfall Tracking Application: Design and
Assignment Topic:
Implementation
Assignment 4
Assignment Number:
80
Total Marks:




Submitted in partial fulfilment of the requirements for Advanced Programming, UNISA 2026

, UNISA | COS3711 Advanced Programming — Assignment 4


e



Question 1: System Design

The rainfall-tracking scenario describes a container holding rainfall observations, a component that
renders that data as an XML document, and a family of interchangeable graph renderers that con-
sume the XML. A clean object-oriented design separates these three concerns and lets the Clien-
t/GUI class coordinate between them without any single class knowing the internal detail of an-
other.


1.1 Partial UML Class Diagram


Four responsibilities emerge directly from the scenario. RainData stores one observation (station,
date, amount). RainRecord is the container that aggregates many RainData objects. RainXml
is solely responsible for converting a RainRecord into the XML format required by the graphing
applications, and is implemented as a singleton since only one XML-generation service is needed
application-wide. Graph is an abstract base that defines the interface every graph type must hon-
our, with BarGraph and ColumnGraph as concrete strategies. The Client class owns the RainRecord,
requests the XML representation from RainXml, and forwards it to whichever Graph the user se-
lected.


1.2 Is the Pattern Behavioural?


The claim needs qualifying rather than a flat yes or no, because the scenario actually calls for two
separate patterns operating in different parts of the design. Choosing between a bar graph and a
column graph at runtime, while keeping both behind one Graph interface, is the Strategy pattern,
and Strategy is correctly classified as behavioural because it is concerned with how an algorithm
is selected and executed, not with how an object is created or how classes are composed struc-
turally. However, the single shared point of access used for XML generation (RainXml) is a Single-
ton, which is a creational pattern since its concern is controlling object instantiation, not runtime
behaviour. So the statement is true only for the graph-selection part of the design; it does not hold
for the XML-generation part.


1.3 Reflective RainData Class


Qt’s meta-object system can still invoke a private slot through QMetaObject::invokeMethod()
even though ordinary client code cannot call it directly, which is exactly the restriction the question

Page 2 of 11

Connected book
 image
Publisher: 1970 ISBN: 9780983384021 Edition: Unknown

Document information

Uploaded on
July 25, 2026
Number of pages
11
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.11

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.
BeeNotes
4.1
(40)
Sold
331
Followers
0
Items
974
Last sold
14 hours 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