Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 10 páginas
Examen

COS3711 Assignment 4 2026 Advanced Programming Year Module, 2026

Document preview thumbnail
Vista previa 2 fuera de 10 páginas

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.

Vista previa del contenido

UNIVERSITY OF SOUTH AFRICA (UNISA)
College of Science, Engineering and Technology — Computer Science Department







Assignment 4
Rainfall Tracking Application: Design Patterns, XML, Regular Expressions and Threading







Module Code: COS3711

Module Name: Advanced Programming

Assignment No.: Assignment 4

Tutorial Letter: 104/0/2026

Semester: Year Module, 2026




Submitted in partial fulfilment of the requirements for Advanced Programming
at the University of South Africa.

, UNISA | COS3711 Advanced Programming — Assignment 4



Question 1: UML Design of the Rainfall Tracking System

The rainfall scenario asks for a container of rain records, each holding a station code, a date and a
millimetre value, together with a mechanism for turning that container into an XML representation
that can be handed to a choice of graph. A client class owns the record and decides which graph
to draw, which points directly at the Strategy pattern: the graph type is an interchangeable algo-
rithm selected at runtime by the client, and the family of graphs shares a common interface so the
client does not need to know which concrete graph it is holding (Gamma et al., 1994:315).


1.1 Partial UML Class Diagram


The design below separates four responsibilities: the RainData class that holds a single reading,
the RainRecord container that aggregates all readings and can produce an XML string, the Graph
interface with its two concrete strategies BarGraph and ColumnGraph, and the Client class that
owns the record, requests the XML, and delegates drawing to whichever graph the user selects.

Client / GUI

− record : RainRecord
− graph : Graph*

+ setGraph(g : Graph*) : void
+ requestGraph() : void
+ addRainData(d : RainData) :
void uses

1

RainRecord
Graph
− readings : QVector<RainData>

+ addReading(d : RainData) : void + draw(xml : QString) : void
+ toXml() : QString
1 ...*
RainData

− station : QString
BarGraph ColumnGraph
− date : QDate
− mm : double
+ draw(xml : QString) : void + draw(xml : QString) : void
+ getStation() : QString
+ getDate() : QDate
+ getMm() : double


Figure 1: Partial UML class diagram for the rainfall tracking application

The diagram shows how data moves through the system. RainData objects are aggregated inside
RainRecord, which is itself held by the Client. The client calls toXml() on its record and passes
the resulting string to whichever concrete Graph the user has chosen through setGraph(), so no
graph class needs to know how the XML was built.




Page 1 of 9

Libro relacionado
 image
Desconocido Advanced Programming
Editorial: 1970 ISBN: 9780983384021 Edición: Desconocido

Información del documento

Subido en
25 de julio de 2026
Número de páginas
10
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$16.11

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
LectureLab
3.6
(86)
Vendido
683
Seguidores
188
Artículos
1553
Última venta
1 semana hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes