Write a program that will read in a line of text and outputthe number of words i
ID: 3618151 • Letter: W
Question
Write a program that will read in a line of text and outputthe number of words in the line and the number of occurances ofeach letter. Define a word to be any string of letters that isdelimited by either whitespace, a periiod, a comma, or thebeginning or end of the line. You can assume that the inputconsists entirely of letters, whitespace, commas, and periods. Whenoutputting the number of letters that occur in a line, be sure tocount upper and lower case versions of a letter as the same letter.Output the letters in alphabetical order and list only thoseletters that do occur in the input line.For example, the input line I say Hi. should be output similar to the following 3 words 1 a 1 h 2 i 1 s 1 y Write a program that will read in a line of text and outputthe number of words in the line and the number of occurances ofeach letter. Define a word to be any string of letters that isdelimited by either whitespace, a periiod, a comma, or thebeginning or end of the line. You can assume that the inputconsists entirely of letters, whitespace, commas, and periods. Whenoutputting the number of letters that occur in a line, be sure tocount upper and lower case versions of a letter as the same letter.Output the letters in alphabetical order and list only thoseletters that do occur in the input line.
For example, the input line I say Hi. should be output similar to the following 3 words 1 a 1 h 2 i 1 s 1 y