Page 1 of 1

You have a file “word.txt” which contains some words. Your task is to write a C++ program to find the frequency of each

Posted: Thu May 05, 2022 12:45 pm
by answerhappygod
You have a file “word.txt” which contains some words. Your task is to write a C++ program to find the frequency of each word and store the word with its frequency separated by a coma into another file word_frequency.txt. Then read word_frequency.txt file and find the word which has the maximum frequency and store the word with its frequency separated by a coma into another file “max_word.txt”. Your program should contain the following functions: 1) read function: to read the data.txt and word_frequency.txt file into arrays when needed. 2) write function: to write the results obtained by frequency function and max function in word_frequency.txt and max_word.txt respectively, when needed. 3) frequency function: to find the frequency of each word. 4) max function: to find the word with maximum frequency
(use header file iostream fstream and strings only)
please write code also and use c++ syntax