Example: Summing up Vowels

Write a program that inputs text (string), calculates and prints the sum of the values of vowels according to the table below:

a e i o u
1 2 3 4 5

Sample Input and Output

Input Output Input Output
hello 6
(e+o = 2+4 = 6)
bamboo 9
(a+o+o = 1+4+4 = 9)
hi 3
(i = 3)
beer 4
(e+e = 2+2 = 4)

results matching ""

    No results matching ""