Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hi i need help with this problem in c++. thank you. 1. Write a program freq.cc which reads in a list of words and produce

hi i need help with this problem in c++. thank you. image text in transcribed
1. Write a program freq.cc which reads in a list of words and produce two lists of output . The first list is the list of distinct words in the file as well as the number of times each word occursin the input. The words should first be converted to lower case (write a helper function to convert a character to its lower case equivalent and use transform in STL). This list should be sorted in "dictionary order based on the words. If the list of words is: abcd Computer science computer games The output should look like (the exact format is up to you) Word Frequency abcd computer games science The second list is the list of distinct words sorted in decreasing frequency Words with the same frequency should be listed in "dictionary order." For the list above the output should look like: Frequency Word 2 computer abcd 1 games 1 science You may assume that the words are separated by white space. The list is terminated by end-of-file Hint: You may wish to use a map to build the first list, and a vector of pairs to build the second list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

What is the conjugate of 3 + 4i?

Answered: 1 week ago

Question

You have

Answered: 1 week ago