Write a program that calculates the frequency counts ofvarious characters and ot
ID: 3618064 • Letter: W
Question
Write a program that calculates the frequency counts ofvarious characters and other interesting items: 1) Obtain file names from the user for both input and output.This must be a function call. As a hint, do not open this file foroutput and input right away. 2) Calculate the frequencies for each letter in the alphabetfor A through Z (NOT case-sensitive meaning capital “A”and lowercase “a” are the same). 3) Calculate the frequencies of the white space in theprogram. 4) Calculate the number of uppercase and lower caseletters. 5) Write your results to a new file specified by theuser. 6) Your output file should look similar to below (the numbersof course depend on your file): Letter Frequencies: A 10 B 13 C 20 D 0 E 17 F 4 Rest of Letters Upper Case 50 Lower Case 17 White Space 10 Write a program that calculates the frequency counts ofvarious characters and other interesting items: 1) Obtain file names from the user for both input and output.This must be a function call. As a hint, do not open this file foroutput and input right away. 2) Calculate the frequencies for each letter in the alphabetfor A through Z (NOT case-sensitive meaning capital “A”and lowercase “a” are the same). 3) Calculate the frequencies of the white space in theprogram. 4) Calculate the number of uppercase and lower caseletters. 5) Write your results to a new file specified by theuser. 6) Your output file should look similar to below (the numbersof course depend on your file): Letter Frequencies: A 10 B 13 C 20 D 0 E 17 F 4 Rest of Letters Upper Case 50 Lower Case 17 White Space 10Explanation / Answer
please rate - thanks #include #include #include #define UP 65 #define LOW 97 using namespace std; int openfiles(ifstream&,ofstream&); void checkletter(char,int[],int&,int&,int&); int main() { ifstream in; ofstream out; int count[26]={0},space=0,upper=0,lower=0,i; string input; i=openfiles(in,out); if(i!=0) {system("pause"); return 0;; } getline(in,input); while(in) { for(i=0;input[i]!='';i++) checkletter(input[i],count,space,upper,lower); getline(in,input); } outRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.