COS3711 Assignment 3 (COMPLETE ANSWERS) 2024 - DUE 9 September 2024
20 keer bekeken 0 keer verkocht
Vak
Advanced Programming (COS3711)
Instelling
University Of South Africa (Unisa)
Boek
Python Advanced Programming
COS3711 Assignment 3 (COMPLETE ANSWERS) 2024 - DUE 9 September 2024 ; 100% TRUSTED workings, explanations and solutions. for assistance Whats-App 0.6.7..1.7.1..1.7.3.9 ........... Question 1
Write an application that can be used to process Staff member details. The fields that should be
stored in...
// Setters
void setName(const QString& name);
void setBirthdate(const QDate& birthdate); Terms of use
void setAppointmentType(const QString& type);
By making use of this document you agree to:
• Use this document as a guide for learning, comparison and reference purpose,
• Not to duplicate, reproduce and/or misrepresent the contents of this document as your own work,
• Fully accept the consequences should you plagiarise or misuse this document.
Disclaimer
Extreme care has been used to create this document, however the contents are provided “as is” without
any representations or warranties, express or implied. The author assumes no liability as a result of
reliance and use of the contents of this document. This document is to be used for comparison, research
and reference purposes ONLY. No part of this document may be reproduced, resold or transmitted in any
form or by any means.
, +27 67 171 1739
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.
private:
QString name;
QDate birthdate;
AppointmentType appointmentType;
Disclaimer
Extreme care has been used to create this document, however the contents are provided “as is” without
any representations or warranties, express or implied. The author assumes no liability as a result of
reliance and use of the contents of this document. This document is to be used for comparison, research
and reference purposes ONLY. No part of this document may be reproduced, resold or transmitted in any
form or by any means.
, +27 67 171 1739
// Static method to convert between QString and AppointmentType
static QString appointmentTypeToString(AppointmentType type);
static AppointmentType stringToAppointmentType(const QString&
type);
};
QString Staff::appointmentTypeToString(Staff::AppointmentType type)
{
switch(type) {
case AppointmentType::Permanent: return "Permanent";
case AppointmentType::PartTime: return "Part-time";
case AppointmentType::Contract: return "Contract";
default: return "";
}
}
Staff::AppointmentType Staff::stringToAppointmentType(const QString&
type) {
if (type == "Permanent") return AppointmentType::Permanent;
if (type == "Part-time") return AppointmentType::PartTime;
if (type == "Contract") return AppointmentType::Contract;
throw std::invalid_argument("Invalid appointment type");
}
///
### StaffList.h
/// cpp
#ifndef STAFFLIST_H
Disclaimer
Extreme care has been used to create this document, however the contents are provided “as is” without
any representations or warranties, express or implied. The author assumes no liability as a result of
reliance and use of the contents of this document. This document is to be used for comparison, research
and reference purposes ONLY. No part of this document may be reproduced, resold or transmitted in any
form or by any means.
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper iStudy. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor $2.85. Je zit daarna nergens aan vast.