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 3 fuera de 23 páginas
Examen

COS3711 Assigment 3 Year Module Due 2026

Document preview thumbnail
Vista previa 3 fuera de 23 páginas

Comprehensive Study Material; Expert Verified & Exam-Ready This assignment package has been carefully developed to support serious academic preparation. Each solution is thoroughly researched, clearly explained, and backed by credible references giving you not just the answers, but a genuine understanding of the underlying concepts. The material is structured for clarity, making even complex topics approachable without sacrificing depth or accuracy. Whether you're consolidating your knowledge or preparing under time pressure, these resources are designed to help you walk into any exam with confidence.

Vista previa del contenido

UNIVERSITY OF SOUTH AFRICA
College of Science, Engineering and Technology


⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄


COS3711: Advanced Programming

Assignment 3 — 2026

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄




COS3711
Module Code:
Advanced Programming
Module Name:
Assignment 3
Assignment:
2026
Year:




Submitted in partial fulfilment of the require-
ments for Advanced Programming — UNISA 2026

, UNISA | COS3711 Advanced Programming – Assignment 3



Question 1: GetStudent – GUI with Input Masks and Regular Expression Validation

The GetStudent application is a standalone Qt GUI program that collects a student number,
module code, and mark from the user. Input masks provide first-level formatting guidance,
while QRegularExpression validators enforce the exact rules specified in the assignment.
On submission, the data is printed to standard output so that a parent process can read it in
Question 2 (Blanchette and Summerfield, 2008).


1.1 Validation Rules


The three fields and their rules are:

Table 1: Input validation rules for GetStudent
Field Rule Regex Pattern
Student Number Exactly 4 digits ^[0-9]{4}$
Module Code 3 uppercase letters, then 1/2/3, ^[A-Z]{3}[123][0-9]{2}[A-Za-z0-9]$
then 2 digits, then 1 alphanumeric
Mark Integer 0 to 100 ^(100|[0-9]{1,2})$



1.2 getstudent.h

1 # ifndef GETSTUDENT_H
2 # define GETSTUDENT_H
3


4 # include < QMainWindow >
5 # include < QRegularExpressionValidator >
6

7 Q T_ BE GI N_NA ME SP AC E
8 namespace Ui { class GetStudent ; }
9 QT_END_NAMESPACE
10

11 class GetStudent : public QMainWindow {
12 Q_OBJECT
13 public :
14 explicit GetStudent ( QWidget * parent = nullptr ) ;
15 ~ GetStudent () ;
16


17 private slots :



Page 2 of 23

, UNISA | COS3711 Advanced Programming – Assignment 3



18 void o n _ a d d B u t t o n _ c l i c k e d () ;
19


20 private :
21 Ui :: GetStudent * ui ;
22 bool validateInputs ( QString & errorMsg ) ;
23 };
24

25 # endif // GETSTUDENT_H




1.3 getstudent.cpp

1 # include " getstudent . h "
2 # include " ui_getstudent . h "
3 # include < QRegularExpression >
4 # include < QRegularExpressionValidator >
5 # include < QMessageBox >
6 # include < QTextStream >
7 # include < iostream >
8

9 GetStudent :: GetStudent ( QWidget * parent )
10 : QMainWindow ( parent ) , ui ( new Ui :: GetStudent )
11 {
12 ui - > setupUi ( this ) ;
13


14 // -- Input masks give the user a visual format guide --
15 // Student number : 4 digits
16 ui - > studentNumberEdit - > setInputMask ( " 9999 " ) ;
17


18 // Module code : 3 uppercase letters + [123] + 2 digits + 1 alphanum
19 // No built - in mask for mixed alpha / digit at position 4 , so we use
20 // a validator instead and guide with placeholder text .
21 ui - > moduleCodeEdit - > set Pl ac eh ol de rT ex t ( " e . g . COS3711A " ) ;
22 ui - > moduleCodeEdit - > setMaxLength (7) ;
23


24 // Mark : up to 3 digits
25 ui - > markEdit - > setInputMask ( " 900 " ) ; // allows 0 -999; regex tightens
to 0 -100
26




Page 3 of 23

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

Información del documento

Subido en
24 de marzo de 2026
Número de páginas
23
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$4.91

¿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.
BeeNotes
4.1
(40)
Vendido
331
Seguidores
0
Artículos
974
Última venta
18 horas 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