Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago