Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help on the Trend File Output section which is the c and h file as well as

ID: 3687973 • Letter: N

Question

Need help on the Trend File Output section which is the c and h file as well as the main code. Last two pictures are the hashtag.cpp file needed. Please review the Projeet Companion for general instruetions reganding submission instructions and formatting of submission materials. The reguirements for the alpha submission are detailed in the final section of the project description. ructions reganding submission instruct Usage Usage: trending startHashtagFile endHashtagFile trendFile Requirements Summary Create a C+ program that that analyzes the frequency of the occurence of hashtags within two inputs files, a startHashtagFile and an endHashtagPile. The program will analyze the change in rank of specific hashtags from the startHashtagFile to the endHaahtagFile, where the highest ranked hashtag(.e, hashtag ranked in position 1) appears most frequently. Finally, the program will output a ranked list of all hashtags appearing in the endHashtagrile along with the relative change in the rank for each hashtag from the startHashTagPile to the endHashtagFile Assignment Name The assignment name for this assignment is: trending 1. Input Hashtag Files For this assignment, the input text file will only consist of the uppercase and lowercase characters (a' to .'A' to Z). Each hashtag within the text file will be separated by one or more whitespace characters(','t,'n'.'n 2. Hashtag Class The following Hashtag class definition must be used for the assignment. You may need to to create your own classes to do other tasks class Hashtag f private: // The hashtag itself string word: int startcount: / Number of occurrences in start file int endCount: Number of occurrences in end file int startRank: //Rank in start file int endRank; // Rank in end file public: Hashtag (string word): // Default constructor Hashtag (string word, int startCount, int endCount 0) // Getter and setter functions for hashtag word, counts, and ranks

Explanation / Answer

#include #include #include using namespace std; const int TABLE_SIZE = 5; /* * HashNode Class Declaration */ class HashNode { public: int key; int value; HashNode(int key, int value) { this->key = key; this->value = value; } }; /* * DeletedNode Class Declaration */ class DeletedNode:public HashNode { private: static DeletedNode *entry; DeletedNode():HashNode(-1, -1) {} public: static DeletedNode *getNode() { if (entry == NULL) entry = new DeletedNode(); return entry; } }; DeletedNode *DeletedNode::entry = NULL; /* * HashMap Class Declaration */ class HashMap { private: HashNode **htable; public: HashMap() { htable = new HashNode* [TABLE_SIZE]; for (int i = 0; i key == key) htable[hash_val]->value = value; } } else htable[hash_val] = new HashNode(key, value); } } /* * Search Element at a key */ int Search(int key) { int hash_val = HashFunc(key); int init = -1; while (hash_val != init && (htable[hash_val] == DeletedNode::getNode() || htable[hash_val] != NULL && htable[hash_val]->key != key)) { if (init == -1) init = hash_val; hash_val = HashFunc(hash_val + 1); } if (htable[hash_val] == NULL || hash_val == init) return -1; else return htable[hash_val]->value; } /* * Remove Element at a key */ void Remove(int key) { int hash_val = HashFunc(key); int init = -1; while (hash_val != init && (htable[hash_val] == DeletedNode::getNode() || htable[hash_val] != NULL && htable[hash_val]->key != key)) { if (init == -1) init = hash_val; hash_val = HashFunc(hash_val + 1); } if (hash_val != init && htable[hash_val] != NULL) { delete htable[hash_val]; htable[hash_val] = DeletedNode::getNode(); } } }; /* * Main Contains Menu */ int main() { HashMap hash; int key, value; int choice; while(1) { cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote