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 16:20
Octothorpe is another name for what common computer keyboard symbol?
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
All of the following are characteristics that must be contained in any knowledge representation scheme except
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
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, 26.02.2021 15:30
question
Physics, 26.02.2021 15:30
question
Computers and Technology, 26.02.2021 15:30
question
Mathematics, 26.02.2021 15:30
Questions on the website: 13722362