Answered step by step
Verified Expert Solution
Link Copied!

Question

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 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

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions

Question

1. Why do people tell lies on their CVs?

Answered: 1 week ago

Question

2. What is the difference between an embellishment and a lie?

Answered: 1 week ago