This is my project that is due later tonight. I have been trying to figure out what i am suppose to be doing for this project. Got any hints that would be grateful.
Here is what i started trying to do. I have been trying to create a file called "friendsType.h". however i can't get this to work in any way and same thing when i tried to format the "struct nodType".
Again if you can help me get started that would be great. thanks
Below is the project that i am doing.
This project requires you to write a C++ program that will manipulate data stored in a self-organizing linked list. A self –organizing list moves frequently used entries to the beginning of the list. This program will give you practice inputting data from files, writing and calling functions, using a linked list, and outputting data to a file. You should only use one linked list.
The infotype in this problem will consist of a name (string), a phone number (string) and a counter (int). Whenever a phone number is looked up, one is added to the counter for that node.
Datafile “friends.txt” contains lines of the following format:
<name> <phone number >
Data items are separated by blanks.
Each line of file “Lookup.txt” contains a name.
Store the data from file “friends.txt” in a linked list using pointers. The order of items in the list should be the same as the order in the file. After the list is created, print out the linked list.
For each entry from “Lookup.txt”, search the linked list for the input name. Print to the screen the name and phone number. Print a message for names that are not found. In addition, increment the counter in the node. If the counter in a node becomes 3, reset the counter to zero and move that entry to the beginning of the list.
After all entries from “Lookup.txt” are processed, print out the list of names, phone numbers and counters to the screen. Also, create an output file containing the list of names, phone numbers, and counters.
Notes: Work incrementally!
1. Remember to review the grading algorithm.
2. Save a copy of the file you hand in. Make sure to leave the file unchanged after your submission until you receive a grade on the project assignment.
3.The data file should be error free- let me know if you find errors in the sample data
4. Do not use global variables.
6. You should use functions to accomplish each task. Use function prototypes. Declare the main function before you declare additional functions.
7 Print an error message if the either input file is missing.
Friends.txt
Brite,Brenda 410-123-4567
Carpenter,Candace 410-123-4444
Delray,Don 410-123-5555
Ellis,Ellen 410-123-9876
Fink,Fred 410-123-8765
Popular,Pat 410-123-6666
Jenkins,Jan 337-471-1111
Hacker,Harry 888-123-3333
Hacker,Horatio 888-321-6543
Hacker,Henry 888-321-6544
Hacker,Henrietta 888-321-6545
Hacker,Hillary 888-321-6543
Zappa,Zeke 888-345-5555
Kruella,Karen 888-345-9999
Martens,Max 800-234-7777
Rabbitz,Lucky 999-333-1111
Overton,Oscar 410-471-2222
Wallace,Wally 888-555-5656
Hacker,Hortense 888-321-6546
Yodler,Yancy 410-742-8888
Miles,Morticia 410-543-0444
lookup.txt
Popular,Pat
Hacker,Harry
Popular,Pat
Fink,Fred
Zappa,Zeke
Hacker,Harry
Brite,Brenda
Popular,Pat
Delray,Don
Delray,Don
Popular,Pat
Zappa,Zeke
Wallace,Wally
Popular,Pat
Kruella,Karen
Brite,Brenda
Kruella,Karen
Hacker,Harry
Brite,Brenda
Missin,Marvin
Kruella,Karen
Popular,Pat
Brite,Brenda
Hacker,Harry
Findem,Kenya
Hacker,Henrietta