First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "CharCounter" (without the...


First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).


Then create a new Java application called "CharCounter" (without the quotation marks) that gets two Strings called inputEntry and inputCharacter from the user at the command line. Allow for the inputEntry String to be one or more words of input. Check that the inputCharacter String has a length of 1 and note these validations:



  • If it doesn't, provide the user with suitable feedback and conclude the program.

  • If the inputCharacter 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 inputCharacter is "e" you would output: "There is 1 occurrence(s) of 'e' in test."



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here