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