answersLogoWhite

0

String passage= new String("blah blah blah");

int vowelSum=0;

for(int i=0;i<passage.length();i++)

if(passage.charAt(i)=='a' passage.charAt(i)=='e' ...etc....

vowelSum+=1;

System.out.println(vowelSum);

That is a basic idea and in no way the best possible way to do it.

JBuck

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

What is an algorithm to calculate the sum of the digits of a three digit number?

algorithm is a way to solve your problem


How do you calculate total and average using algorithm?

To calculate the total and average using an algorithm, first, iterate through a collection of numbers and sum them up to get the total. Then, divide the total by the count of numbers in the collection to find the average. The algorithm can be outlined as follows: initialize a total variable to zero, loop through each number to add it to the total, and finally divide the total by the number of elements to get the average. This process can be implemented in various programming languages using loops and basic arithmetic operations.


How to write an algorithm that accepts five numbers and displays the sum and average of the numbers?

1.Start Algorithm 2.Enter first number 3.Enter second number 4.Enter third number 5.Enter fourth number 6.Enter fifth number 7.Add five number 8.display five number / 2 9.Display result 10.End Algorithm


Where do you run an algorithm?

By preparing test cases we can test an algorithm. The algorithm is tested with each test case.


What is the average case time complexity of the Bubble Sort algorithm?

The average case time complexity of the Bubble Sort algorithm is O(n2), where n is the number of elements in the array being sorted.


What is the average running time of Dijkstra's algorithm for finding the shortest path in a graph?

The average running time of Dijkstra's algorithm for finding the shortest path in a graph is O(V2), where V is the number of vertices in the graph.


If you have the average how to calculate the total?

Multiply the average by the number of terms.


How to calculate average change IN INVENTORY?

You calculate average change in inventory by dividing the turnover by how many times it has turned over. The number you get is the average.


How do you you calculate the square root of a number manually without a calculator?

Use the link provided to University of Arizona math page where the algorithm is explained.


Why is the answer derived from an algorithm not the same as an average for example IQ scores are not an average of the subtest scores but a score derived from an algorithm?

it is obvious the average is not by just one person it is by a group of people so you need to ask a group of people what their IQ is and add them all up then divide them by the number you used


How do you calculate the simple moving average?

To calculate the simple moving average, add up the closing prices of a set number of time periods and then divide by the number of periods.


How do calculate the number needed to increase an average?

To calculate the number needed to increase an average, first determine the current average and the desired average. Then, multiply the current average by the total number of items to find the total sum. Next, calculate the total sum needed for the desired average by multiplying the desired average by the same number of items. Finally, subtract the current total sum from the desired total sum to find the amount needed to increase the average.