Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:40, cutybrain6054
Sarah is having a hard time finding a template for her advertising business that she may be able to use at a later date and also make it available to her colleagues
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, osirisarellane3792
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
image
Computers and Technology, 24.06.2019 15:30, PresleyPie9452
George is working as a programming team lead. which statements correctly describe the skills that he requires?
Answers: 3
image
Computers and Technology, 24.06.2019 17:50, veneciaconton347
You will subnet the network address 172.31.103.0/24. the network has the following requirements: · room-114 lan will require 27 host ip addresses · room-279 lan will require 25 host ip addresses · room-312 lan will require 14 host ip addresses · room-407 lan will require 8 host ip addresses how many subnets are needed in the network topology?
Answers: 2
Do you know the correct answer?
Eclipse(java)write a program that analyzes text written in the console by counting the number of tim...

Questions in other subjects:

Konu
Mathematics, 10.09.2020 22:01
Konu
Mathematics, 10.09.2020 22:01
Konu
Mathematics, 10.09.2020 22:01
Konu
Mathematics, 10.09.2020 22:01
Konu
Chemistry, 10.09.2020 22:01
Konu
Mathematics, 10.09.2020 22:01
Konu
Mathematics, 10.09.2020 22:01
Konu
Mathematics, 10.09.2020 22:01
Konu
English, 10.09.2020 22:01
Konu
Spanish, 10.09.2020 22:01