Question
hi i have two questions i need help on 1. Write a complete Java program called CharCounter that gets two Strings called inputWord and inputCharacter
hi i have two questions i need help on
1. 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. 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."
2. Write a complete Java program called EvenThough that uses a while loop to check the numbers 1 through 20 and prints only those numbers that are even. Use division to determine an even number (i.e., when divided by 2 the result yields no remainder). All output should appear on a single line. Thanks!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started