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
You have a file “word.txt” which contains some words. Your task is to write a C++ program to find the frequency of each
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
You have a file “word.txt” which contains some words. Your task is to write a C++ program to find the frequency of each
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!