answersLogoWhite

0


Best Answer

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

15y ago
This answer is:
User Avatar
More answers
User Avatar

Dhanya Lucky

Lvl 2
3y ago

Hello

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How would you write an algorithm to calculate the average number of vowels in a passage?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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


Where do you run an algorithm?

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


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.


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


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 average of a list of numbers?

If you want to calculate the average of a list of numbers, add the numbers together and divide it by the number of numbers.


How do you calculate shortest seek time first algorithm Average?

The first step is to convert the logical device number into a physical address. Then you must schedule an IO request. You improve the seek time by testing the IO numbers to see what gives the best results.


How do you calculate average value?

(sum of data)/number of data


How do you calculate Average Handling Time in call centre?

to calculate your average handling time: average talk time+after callwork+hold time divided by the number of calls


What are steps of algorithm?

the number of steps of an algorithm will be countable and finite.