COS3711 2023 ASSIGNMENT 1
DISCUSSION
(with the source code you need)
Crystal Indigo!
Crystal Indigo!
Providing all solutions you need anytime
+27 76 626 8187
***copy and run the code in Qt Creator ***
*** There is a link to the source code at the end of this discussion***
if there is a program that is not running, please contact
Note: do not submit as pdf and change the code where necessary
,Question 1:
Write an application that can be used to keep a list of staff member details. Each staff member
data should include the following:
1. A name
2. A birthdate, and
3. A staff appointment type (one of permanent, part-time, or contract, stored and handled as an
enum).
Include all necessary getter and setter functions. An additional getter can be used to return the
appointment type as a Qstring. The application should allow a user to enter details via a GUI. Also,
once a staff member’s details are entered, they should be saved to a list/container in the application.
The user should be able to write this list to file (in any acceptable, human-readable format) when
needed.
Ensure that you adhere to basic design principles and avoid any anti-patterns in the design of
your solution.
Discussion:
The application consists of three classes: MainWindow, StaffMember, and
StaffListModel. In the initial solution provided, the StaffMember class is responsible for
storing the details of a staff member, including their name, birthdate, and staff appointment type. In
the first part of the solution, the StaffMember class is defined with three private data members -
m_name, m_birthdate, and m_staffAppointment. These data members represent the
name, birthdate, and appointment type of a staff member, respectively.
The StaffMember class also provides public getter and setter functions for each of its private
data members, allowing external code to access and modify the staff member's information.
Additionally, the class provides a function that returns a string representation of the staff member's
information.
Overall, the StaffMember class encapsulates the data and behaviour related to an individual staff
member, providing a clean and modular way to represent and manipulate staff member information
in the application.
class StaffListModel : public QAbstractListModel
{
Q_OBJECT
public:
StaffListModel();
StaffListModel(QObject *parent = nullptr);
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 CrystalIndigo. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $12.40. You're not tied to anything after your purchase.