Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

CharCounter

Question

Write a complete Java program called CharCounter that gets two Strings called inputWord and inputCharacter from

the user at the command line. Check that the character has a length of 1.

  • If it doesn’t, provide the user with suitable feedback and conclude the program.
  • If the character length is valid (i.e., it has a length of 1), use a while loop to check each position in the inputWord variable and return the number of times the character occurs. For example, if the inputWord is “test” and the inputCharacter is “e” you would output: “There is 1 occurrence of ‘e’ in test.”

PA – AtmSimWhileLoop” aria-describedby=”msf1-previous-desc” >Previous PA – EvenThough” aria-describedby=”msf1-next-desc” >Next

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"