$20.99
Problem Specification:
New Horizon is a computer learning centre that provides training for companies and public. The centre needs a good computer program to keep track of all the training sessions that they are providing. In this assignment, you are required to implement a class named Training. The Training class should be able to keep the training id, description of the training, the training date, time, charges (per person), the number of participants registered, a list of participant’s id (MyCard Number), and a list of participant’s first name and last name. You can assume that a maximum of 30 participants may register in a training session.
A Training object should be able to perform the following functions:
§ Register a new participant – this will involve getting the participant’s id, first name, and last name from the user. There should be a checking on the number of participants already registered so far in the training session. If it is full, no new registration should be allowed. Number of participants registered should be updated accordingly.
§ Remove a participant – this will involve asking the user for the training id and the participant’s id. If the participant is registered, the participant’s information (id and last name) should be removed. Decide on the suitable method to perform this. Number of participants registered should also be updated accordingly.
§ Modify a Traning session – this may involve modifying a training id, description, date, time, and/or charges per person
§ Display a Training details – this will print out the details of the training session together with all participants’ id, first names, and their last names and also the total charges for that training session.
Include suitable constructors, a destructor, and the necessary set and get functions for the class. Place your implementation of the above functions in the file Training.cpp. Ensure your file includes the header Training.h which contains the Training declaration.
Write a main() program to test your class. The main() function should start with reading a filename to read a number of Training sessions. The first line in the file should be the number of Training provided followed by the details of each training session. The following shows a sample input file.
2
T1101
Basic Web Programming Course
1/12/2013
8:00 – 17:00
250.00
2
871012-10-5543
Tony
Stark
700607-10-6231
Bruce
Banner
T2100
Mobile Application Development
20/1/2014 – 22/1/2014
9:00 – 17:00
1500.00
3
600304-06-5121
Clark
Kent
990126-10-1727
Peter
Parker
680501-10-5696
Bruce
Wayne
An array of Training (based on the number read from the file) should be created dynamically then load all the details into each Training object. The application should then allow the user to choose from several options shown below:
– Register a new participant
– Remove a participant from a training session
– Modify a Training details
– Display a Training details
– Quit
Before terminating the program, the Trainings’ details should be saved into the same file opened for input and overwrite all the previous records in the file. The main() function should be saved in a file named main.cpp.
Assessment Criteria:
Assessment Criteria
Marks Allocated
Correctness
1
Coding
3
Readability and Documentation
1
Output (clear and well formatted)
1
Total
6
Submission:
You are to submit the softcopy of the project containing all files (.cpp, .h, and sample text files used) to Moodle.