Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Write a C + + program and utilize STL : You are provided with a manuscript by Hemingway ( OldMan . txt ) , image

Write a C++ program and utilize STL :
You are provided with a manuscript by Hemingway (OldMan.txt), image of file attached, and you are asked to summarize its content by building a histogram of the word sums.
a. Read the manuscript OldMan.txt and store each word and word sum into a Map container Text (string Word, int WrdSum) where WrdSum is the sum all characters in Word threshold down by 65(A) the letter A should have a numerical value of WrdSum
b. Output in descending order the total number of unique entries in the Text (string Word, int WrdSum)
c. Find out the Word with greatest WrdSum (WrdMax)
d. Create Histogram(Histo) array of size WrdMax/50 and initialize it to zero. Calculate each entry and update count how many WrdSum belong in that slot
e. Output contents of histogram (element #, #of words belonging in that slot)
f. Calculate the TotalSum of all entries in the Histo
compare with Text.size()
compare with wc OldMan.txt (Linux function)
Explain differences
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions