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.