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

COS3711 Assignment 3 (QUALITY ANSWERS) 2024

Beoordeling
-
Verkocht
-
Pagina's
21
Cijfer
A+
Geüpload op
25-06-2024
Geschreven in
2023/2024

This document contains workings, explanations and solutions to the COS3711 Assignment 3 (QUALITY ANSWERS) 2024. For assistance call or us on 0.6.8..8.1.2..0.9.3.4...... Question 1 Write an application that can be used to process Staff member details. The fields that should be stored include: • A name, • A birthdate, and • A staff appointment type (one of permanent, part-time, or contract, stored as an enum). Note that the getter and setter for this data member may be done using a QString. Downloaded by Corona Virus () lOMoARcPSD| The application should allow a user to enter details via GUI. Also, once a staff member’s details are entered, they should be written to file (in any acceptable format) and stored in a container in the application. Ensure that you adhere to basic design principles, and avoid any anti-patterns in the design of your solution. Question 2 Taking Question 1 a step further, make all the getters and setters (including any toString() functions) that give access to the data members name, birthdate and staff type private. Then make the necessary changes so that your application uses reflective programming techniques to access the data members in the object that holds the staff data when writing to file. Note that you cannot assume that you know beforehand how many properties there are, what they are called, or of what type they are. You will need to be more specific when handling the enum, though (and in this case you can accept that you know what its values are); also, you will have to move away from using a QString for the enum here. HINT: You will need to use QVariant. Question 3 Write an application that uses regular expressions to check for problems in a text file provided by a user. The following functionality should be included. • The user should be able to select the file to check using a standard file open dialog box. • There should be some way of indicating that the file has been loaded. • Problematic words should be displayed, giving the line number and the word number in the line as well. The following problematic words should be flagged (using regular expressions to identify such words): • Words with a number anywhere in the word • Words with a capital letter in any position apart from at the start of the word. Downloaded by Corona Virus () lOMoARcPSD| • Words that have any special characters (like #, *, /, @, ^, and so on) as part of the word. Note that a – is acceptable. The screenshot below gives examples of words that should be flagged. Question 4 Write an application that can check passwords (using regular expressions) and indicate if they are acceptable or not acceptable according to the following rules. • It must be at least 5 characters in length. • It must contain at least one capital/uppercase letter. • It must contain at least one lowercase letter. • It must contain at least one number/digit. • It may not contain any repeating characters (that is, “ele” is acceptable, but “eel” is not). The application should indicate as you type whether the text provided is acceptable and should not rely on the user having to press a button to check acceptability.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

COS3711
Assignment 3 2024
Unique Number:
Due Date: 9 September 2024



This document includes:

• Helpful answers and guidelines
• Detailed explanations and/ or calculations
• References




Connect with the tutor on

+27 68 812 0934

,© Study Shack 2024. All rights Reserved +27 68 812 0934

, QUESTION 1

Sure, let me provide a high-level design and implementation outline for the
application using C++ with the Qt framework. We'll create the necessary
classes to handle this functionality while ensuring proper separation of
concerns.



### High-Level Class Structure



1. Staff class: Represents an individual staff member.

2. StaffList class: Manages a list of Staff objects.

3. StaffWriter class: Handles writing Staff objects to a file.

4. MainWindow class: Provides GUI for user interaction.



### Staff.h
/// cpp
#ifndef STAFF_H
#define STAFF_H

#include <QString>
#include <QDate>

class Staff {
public:
enum class AppointmentType { Permanent, PartTime, Contract
};

Staff(const QString& name, const QDate& birthdate,
AppointmentType type);

// Getters
QString getName() const;
QDate getBirthdate() const;
QString getAppointmentType() const;

// Setters
void setName(const QString& name);
void setBirthdate(const QDate& birthdate);
void setAppointmentType(const QString& type);

private:



© Study Shack 2024. All rights Reserved +27 68 812 0934

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
25 juni 2024
Aantal pagina's
21
Geschreven in
2023/2024
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

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.
StudyShack Cornerstone College, Pretoria, Gauteng
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
30790
Lid sinds
9 jaar
Aantal volgers
13937
Documenten
2010
Laatst verkocht
1 uur geleden
Study Guides for Unisa Students

4,1

1800 beoordelingen

5
989
4
336
3
265
2
81
1
129

Populaire documenten

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

Veelgestelde vragen