Question 4: You have a file "word.txt" which contains some words. Your task is to write a C++ program to find the freque

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Question 4: You have a file "word.txt" which contains some words. Your task is to write a C++ program to find the freque

Post by answerhappygod »

Question 4 You Have A File Word Txt Which Contains Some Words Your Task Is To Write A C Program To Find The Freque 1
Question 4 You Have A File Word Txt Which Contains Some Words Your Task Is To Write A C Program To Find The Freque 1 (130.25 KiB) Viewed 24 times
please solve this with code I am posting it the third time .pls use header files
iOSstream
fstream
or string
use c++ syntax
Thanks
Question 4: 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. Example: word.txt word_frequency.txt max_word.txt Happy Happy,2 Sad Happy,2 Sad, 1 Good Good,1 Bad Bad,1 Happy
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply