This program will have names and addresses saved in a linked list. In addition,
ID: 3541245 • Letter: T
Question
This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record.
When the program is run, it will search for a birthday or an anniversary using the current date to compare with the saved date. It will then generate the appropriate card.
Because this will be an interactive system, your program should begin by displaying a menu. Items on the menu should include:
Enter a new name into the address book
Delete a name from the address book
Change a name or date in the address book
Generate birthday cards
Generate anniversary cards
Exit the card program
Each of these sections will call individual functions to perform their appropriate task.
This address book is to be sorted in alphabetical order. Be aware of this when you are entering, deleting, or changing the name, and plan your code accordingly.
For this project, create and display the card created on the screen (you do not need to print it). You may design the layout of the card as you wish. For example, it could be:
Dear <name_saved>,
Hope your birthday is really wonderful and this coming year is the best yet!
Love,
John
Explanation / Answer
In any case a linked list would be a pain to maintain db style info. If this is a managed app suggest looking into DataSet. If it's unmanaged then you're stuck with STL containers. I would start by packing all the individual's info into an object and providing some sort of UID so you can find that object easily in say a map. Once all the data is in you can do whatever else is neccessary. If this is a managed app then your life is so much easier, since most everything you would need is already there. I cant write out all of the code here but in managed case lookup: DataSet, ICompare (for a custom sort compare implemenation), Events, that should cover most of the functionallity.
One more note: If you're dealing with STL make your life easier and use VS2005, so you can observe the data in the containers. I have spent weeks debugging problems with wrong data in STL, since we moved to VS2005 these problems are now solved in a couple of hours!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.