Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++: In this lab, you will read in a file, count the letter frequencies in the file, and write the results to a new

IN C++: In this lab, you will read in a file, count the letter frequencies in the file, and write the results to a new file.

You can create your own input files for testing. You will begin by prompting the user for the name of the input file. Your program will read the specified file the user chooses and will continue reading from that file until the EOF (end of file) character. You will also implement a function that reads a paragraph one character at a time and counts the number or frequency of each letter in that paragraph, disregarding upper/lower cases (only 26 possible characters):

void count_letters(ifstream &, int*); 

After you determine the number of letters in that paragraph of the input file, prompt the user for the name of the output file for the letter count in that particular paragraph. You will implement another function to write the number of each letter found in the paragraph:

void output_letters(ofstream &, int*); 

You will put the count_letters() and output_letters() functions in one file: letters.cpp

Note that the count_letters() function only counts for one paragraph. So if there are three paragraphs in the input file, there should be three corresponding output files. In count_letters function, the int pointer input is for an array of the 26 letter counts. You must provide a count for every letter, even if it is 0. You should use arrays instead of vectors. No third party libraries are allowed.

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

What was the role of the team leader? How was he or she selected?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago