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 04:00
Which spereadsheet type will determine how well a bussiness has done over the past year
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
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
Biology, 30.01.2021 18:50
question
Computers and Technology, 30.01.2021 18:50
Questions on the website: 13722362