subject

(main. c File) Counting the character occurrences in a file
For this task you are asked to write a program that will open a file called “story. txt”
and count the number of occurrences of each letter from the alphabet in this file.
At the end your program will output the following report:
Number of occurrences for the alphabets:
a was used – times.
b was used – times.
c was used – times…. …and so, on
Assume the file contains only lower-case letters and for simplicity just a single
paragraph. Your program should keep a counter associated with each letter of the
alphabet (26 counters) [Hint: Use array]
Your program should also print a histogram of characters count by adding
a new function print Histogram (int counters []). This function receives the
counters from the previous task and instead of printing the number of times each
character was used, prints a histogram of the counters. An example histogram for
three letters is shown below) [Hint: Use the extended asci character 254]

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:50
Which are steps taken to diagnose a computer problem? a) reproducing the problem and using error codes b) reproducing the problem and troubleshooting c) using error codes and troubleshooting d) using error codes and stepping functions
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
Which is a false statement considering copyright law? a. when people upload something to the internet they automatically receive a copyright for the work b. the work does not have to contain a copyright notice to be considered having a copyright c. copyright is legal term describing rights given to the creators for literary and artistic works d. personal pictures are always covered by copyrights
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 23.06.2019 01:30
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
You know the right answer?
(main. c File) Counting the character occurrences in a file
For this task you are asked to wr...
Questions
question
History, 25.01.2021 20:30
question
Biology, 25.01.2021 20:30
question
Social Studies, 25.01.2021 20:30
question
Mathematics, 25.01.2021 20:30
Questions on the website: 13722361