Question: Write a java program that will ask the user to input a sentence and a letter. The program will then count the total number of
Write a java program that will ask the user to input a sentence and a letter. The program will then count the total number of words and also the number of times the letter occurs in the sentence and also each word.
For Example:
Please enter a Sentence: The quick brown fox jumped over the lazy dog.
Please enter a Letter: o
Total Number of Words: 9
Total Number of Occurrences of the letter 0: 4
Number of Occurrences of the letter o in each word
The 0
quick 0
brown 1
fox 1
jumped 0
over 1
the 0
lazy 0
dog 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
