Question
Declare a scalar variable named Words having a data type of String. Initialize the variable so that it contains a sentence or two. Declare a
Declare a scalar variable named Words having a data type of String. Initialize the variable so that it contains a sentence or two. Declare a one-dimensional array named LetterCount, having a data type of Integer and 26 elements (one element for each letter of the alphabet). Write the statements to count the number of instances of each letter of the alphabet by examining each character in the string. If the character is the letter a, increment the value of the first element in the second array; if the character is the letter b, increment the value of the second element in the second array; and so on. Perform the count in a case-insensitive way. Assume that the string contains only letters. In a control of your choosing, write the statements to display each letter and the count of the letter.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started