subject

Eclipse(java)write a program that analyzes text written in the console by counting the number of times each of the 26 letters in the alphabet occurs.
uppercase and lowercase letters should be counted together (for example, both âaâ and âaâ should count as an a).
any characters that are not letters should be ignored. you must prompt the user to enter the text to be analyzed.
then, for any letter that appeared at least once in the text, print out the number of times it appeared (and do so in alphabetical order).
an effective way to count characters is to read from the console string-by-string, and loop through all of the characters of each of these strings.
similar to problem a, the hasnext() method of the scanner will be useful, and when testing in eclipse, press enter and then, once on the empty line, press ctrl-d when you are done typing the text.
you must use an array to keep track of how many times each letter is seen in the text.
the array should have 26 elements (one for each letter in the alphabet).
index 0 should be used to track the number of aâs in the file, index 1 to track the bâs, index 2 to track the câs, etc., up to index 25 for the zâs.
you could use a massive if/else block, but the whole reason to use arrays is to make your programs easier.
so, instead, think about how to convert each character you read into the correct index and then increment that value in the array.

for example, if you read an a, then you should increment the value in index 0. specifically, you will need to determine if the character is an uppercase letter (between âaâ and âzâ), a lowercase letter (between âaâ and âzâ), or something else. if it is a letter, convert it into the appropriate index. recall that characters and integers are interchangeable via the ascii table conversion1. consider this example to get you started: char input = 'z'; int index = input - 'a'; // index equals 25, as 'z' is 122 and 'a' is 97you have been supplied junit tests for several example input texts, including an empty text, one with no letters, upper/lower/mixed case letters, and hello world.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
Hi plz 11 ! when planning a table, what step comes first: "define the column headers" or "calculate the number of columns/rows"? a. calculate the number of columns/rows b. define the column headers
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
Click the "draw structure" button to activate the drawing utility. draw two diastereomers of (1z,4r)−1,4−dimethylcyclodecene and name them, including (e)/(z) and (r)/(s) notation. part 1 out of 4 draw the diastereomer containing a chiral center with s configuration here. window open
Answers: 1
You know the right answer?
Eclipse(java)write a program that analyzes text written in the console by counting the number of tim...
Questions
question
Mathematics, 20.10.2020 01:01
question
Mathematics, 20.10.2020 01:01
Questions on the website: 13722360