GeekInterview.com
Series: Subject: Topic:
Question: 32 of 587

Write function vowels to count the vowels and letters

Write function vowels to count the vowels and letters in free text given as string. Then print out the number of occurrences of each of the vowels a, e, i, o and u in the string, the total number of letters, and each of the vowels as an integer percentage of the letter total. Suggested output format is: Numbers of characters: a 3 ; e 2 ; i 0 ; o 1 ; u 0 ; rest 17 Percentages of total: a 13%; e 8%; i 0%; o 4%; u 0%; rest 73%
Asked by: yong ha | Member Since Dec-2011 | Asked on: Dec 3rd, 2011

View all questions by yong ha

Showing Answers 1 - 1 of 1 Answers

I would suggest you make use of string.find() and string.substring() methods, make use of loops and counter variables to achieve the objective.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.