السلام عليكم
اتمني احد يشرح لي هذا البروجكت
Consider the following exercises:
One month prior to elections in parliament based governments many candidates for the parliament are making every possible effort to attract citizens’ vote. One such way is the so called “personalized letters.” Write, compile and run a program that can do the following:
Write to a text file the “message” of the candidate to the citizens. This message can be up to 600 characters long broken down to no more than 8 lines. The candidate for the parliament should be able to write the text himself putting XXXXX in the place where s/he believes the last and first names of the citizens should be placed (no more than 3 times in the whole text). The name and location of the text file is left to the programmer’s free choice.
Read the message from the text file and be able to make changes when the candidate feels is necessary.
Write to a text file citizens’ first and last names, gender and their age. For that purpose the programmer could use a structure.
Ask the candidate what are the gender and the age of the citizens s/he wants to send the message to. Then the program reads the appropriate citizens’ text file and puts their first and last names in an array of records, which is as large as the number of the citizens that should get the “message.”
Write to a text file a “new” message based on the “message” and replacing the XXXXX occurrences with the first and last names of the citizens that are to get the message.
Display the text file that includes the “personalized message” on screen.
The points for the project above will be given based on the following:
Write, compile and run the program using static “message” (not text file) and static array of structures (not dynamic) for 5 citizens the details of who are placed in that array (not in a text file).
Implement #1 and #2 using a class that will be called from the main program.
Implement #3 and #4 using a second class, also, called from the main program.
Implement #5 and #6 in the main program that will include all other appropriate functions necessary and will call upon the two classes.
Following the structured programming and the data hiding paradigms for implementing the program and the classes. Remember: the main function should only include function calls to internal or external functions. Also, not all functions of the classes should be public to the main program and none of them should be described in the header files used for the classes but only in the compiled files.