Rapunzel I could use your help this time its with C-Strings. Iam to write a prog
ID: 3618121 • Letter: R
Question
Rapunzel I could use your help this time its with C-Strings. Iam to write a program that will read in a line of text and outputthe number of words in the line and the number of occurrences ofeach letter. Define a word to be any string of letters that isdelimited at each end by either whitespace, a period, a comma, orthe befinning or end of the line. You can assume that the inputconsists entirely of letters, whitespaces, commas, and periods.When outputting the number of letters that occur in a line, be sureto count upper- and lowercase versions of a letter as the sameletter. Output the letters in alphabetical order and list onlythose letters that do occur in the input line. For example, theinput line I say Hi. should produce output similar to the following: 3 words 1 a 1 h 2 i 1 s 1 y Rapunzel I could use your help this time its with C-Strings. Iam to write a program that will read in a line of text and outputthe number of words in the line and the number of occurrences ofeach letter. Define a word to be any string of letters that isdelimited at each end by either whitespace, a period, a comma, orthe befinning or end of the line. You can assume that the inputconsists entirely of letters, whitespaces, commas, and periods.When outputting the number of letters that occur in a line, be sureto count upper- and lowercase versions of a letter as the sameletter. Output the letters in alphabetical order and list onlythose letters that do occur in the input line. For example, theinput line I say Hi. should produce output similar to the following: 3 words 1 a 1 h 2 i 1 s 1 yExplanation / Answer
please rate - thanks found it! #include #include using namespace std; int countwords( char[]); void letters(char[],char[],int[],int& ); void sort(char[],int[],int); int main() {char b[26],input[100]; int count,lets=0,i; int amount[26]; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.