Question: I need help with my C++ project. Below is what I have and what I need to do. Department of Computer Science The City College

I need help with my C++ project. Below is what I have and what I need to do.

I need help with my C++ project. Below is what I

Department of Computer Science The City College of CUNY CSc 10200-1XB: Introduction to Computing [Summer 2016] Project 2 Due at End of Class on 11 july 2016 [Due date is strictly observed] 1- Rewrite your C++ program in Project 1 to compute the number of words, average length and lengths of the words in the text file words.txt - the input file. Each line in the input file contains exactly one word. The words in the input file are sorted lexicographically in dictionary style. Use an array histogram_words of constant length to compute and store the lengths of the words in the input file. Write the computed statistics into another text file words_statistics.txt - the output file. The output file will contain a line (or lines) at the beginning of the file explaining the output. This is followed by the computed word length statistics. 2- Amend your program to compute the total number of letters and the probability of letters [a - z] in the input file. Use an array histogram_letters of constant length to compute and store the probability of letters in the input file. Write the computed statistics into the output file following the word length statistics. Compare the computed letter probabilities to published data on the Web. 3- The C++ program will be comprised of a main function and a function words_statistics that computes and outputs the computed statistics. The program will include all necessary checks and assertions. 4- Submit a printed report including the full, complete, and documented C++ program and a print-out of the output file. Use formatting instructions to make the layout neat and easy to read. Hesham A Auda 30 June 2016 #include #include #include using namespace std; void word_statistics(string file_name){ string line; std::ifstream infile(file_name); int words_count[14]; for(int i = 0; i line) { int l = line.length(); if(l 13){ words_count[13] += 1; } else{ words_count[l-1] += 1; } no_of_words++; total_length += l; } cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!