Question: Create a new Java application called CharCounter (without the quotation marks) that gets two Strings called inputEntry and inputChar from the user. Allow for the
Create a new Java application called "CharCounter" (without the quotation marks) that gets two Strings called inputEntry and inputChar from the user. Allow for the inputEntry String to be one or more words of input. Check that the inputChar String has a length of 1 and note these validations:
If it doesn't, provide the user with suitable feedback and stop the program.
If the inputChar length is valid (i.e., it has a length of 1), use a while loop to check each position in the inputEntry variable and return the number of times the character occurs. For example, if the inputEntry is "test" and the inputChar is "e" you would output: "There is 1 occurrence(s) of 'e' in test.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
