Program Specification

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.

Task 1

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

Task 2

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).

  • If the first character is A, then it is always followed by the first name and the last name of the participant. There are two possibilities: - The participant is an academic. In this case the fields are firstName, lastName, AcademicTitle. - The participant is a student. In this case the firstName and lastName are followed by the field S (to signify that we are dealing with a student), followed by the Student number.
  • If the first character is P, then the participant last added has paid their fee. The value of its Paid data member should be updated accordingly.
  • If the first character is S, then a letter has already been sent to the participant.
  • If the line contains only white spaces it should be ignored and the program should proceed to the next line.
  • If the directive contains any other character, then an error message should be displayed, together with the line number, and the program should continue.

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.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.