Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN C++ CODING 1. Read the contents of a data file (mytext.dat); 2. Process the frequency of characters (a-z) that appear in the data file
IN C++ CODING
1. Read the contents of a data file (mytext.dat); 2. Process the frequency of characters (a-z) that appear in the data file 3. Print the frequency of characters in the file to the screen; 4. Be able to use an ifstream object; called "charword freq.cpp In this assignment you will implement a program to determine the number of words and the number of occurrences of each letter in a block of text stored in a data file called "mytext.daf". Define a word to be any string of letters that is delimited at each end by either whitespace, a period, a comma, or the beginning or end of a line. You can assume that the input consists entirely of letters, whitespace, commas and periods. When outputting the number of words and letters that occur in a line, be sure to count upper- and lowercase versions of a letter as the same letter. Output the letters in alphabetical order and list only those letters that do occur in the input data file Consider the following example Block of text in the data file hello world ALL is great. HELLO WORLD ALL IS GREAT. hello worlD alL iS great. Output of your program to the screen: 15 words 3 d 3 h 15 1 Your program should be modular, meaning that you should break it up into smaller function(s). Your main program should be as small as possible and well documentedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started