In this assignment you are required to develop a program for managing a list of conference participants. The aim is to read a list from a file and write letters to participants who have not paid their fees.
There are two kinds of participants: academic and students. Each participant has an affiliation, name and address. Academic participants must be addressed by their academic title, and students are recorded by their student number.
You will need to author one class, participant, and two subclasses, academic and student. The participant class should be a virtual class containing data members and member functions that apply to every participants. Each of the three classes should be in its own file with separate header files. Details are below.
Create a class participant based on the following class diagram: See image.
Make sure that all data members are private, and that you create getters and setters. Create also two classes derived from the Participant class, Student and Academic. The Student class should have the additional data member StudentNumber and the Academic class should have the additional data member Title.
The member function Write should write in a file a letter to each participant, addressing them by their academic title (or Mr/Ms if they are students), confirming their attendance to the conference and reminding those who haven’t paid their fees yet to do so. For example, letters could be like:
To: Dr John Smith,
Dear Dr Smith,
On behalf of the organising committee, I would like to confirm your attendance to our conference. I wish to kindly remind you the outstanding fee of $100.
The organiser.
or
To: Mr/Ms Jane Johnson, Student No. 12345
Dear Mr/Ms Johnson,
On behalf of the organising committee, I would like to confirm your attendance to our conference. We acknowledge the reception of the payment for your fees.
The organiser.
The letter should be written in the file FirstName.LastName.out
Create a class Organiser. This class should have one data member, a list of participants. Create a data function for this class, called ProcessFile. This function should read from a file with the following format:
A John Smith Dr
S
P
A Jane Johnson S 12345
The action for each line will depend upon the first character (the directive).
The program should read through the file twice. First, to count the number of participants, in order to dynamically allocate an array of participants. Then, the file should be processed.
Create another function, to be called after the file has been read a second time, which should run through the list of participants and a prepare a letter to all those who have not yet been sent one.
According to good programming practice, all these steps should be broken down into small one-purpose functions, well commented. Functions not meant to be accessed outside of the class Organiser should be private.
Finally, the main file should declare an organiser and call its member ProcessList.