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]: O. C:\WINDOWS\system32\cmd.exe a Press any key to continue
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]: O. C:\WINDOWS\system32\cmd.exe a Press any key to continue
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
solve this question while using only array, function,drawing,file.
during this we are not allow to use getc
And we have to solve it by using c language
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images