COS3711 Assignment 3 (COMPLETE ANSWERS) 2024 - DUE 9 September 2024
20 views 0 purchase
Course
Advanced Programming (COS3711)
Institution
University Of South Africa (Unisa)
Book
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.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller iStudy. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $2.84. You're not tied to anything after your purchase.