Difference between revisions of "Vowel Counter"

From CompSciWiki
Jump to: navigation, search
m (Fixed photo)
m
Line 12: Line 12:
  
 
|SolutionCode=
 
|SolutionCode=
<pre>
 
 
import javax.swing.JOptionPane;
 
import javax.swing.JOptionPane;
  
Line 56: Line 55:
 
     }
 
     }
 
}
 
}
 
</pre>
 
 
}}
 
}}

Revision as of 23:24, 8 April 2010

Back to the Program-A-Day homepage

Problem

Your task is to write a program that takes a string of input from the user, and then count the number of vowels that are contained within this string. As output, provide the user with the final count of vowels, as well as the percentage of all characters in the string that these vowels represent. Repeat this until the user either cancels the input, or enters an empty string. For the purposes of this question, you may treat 'y' as though it is always a consonant (ie, just treat 'a', 'e', 'i', 'o', and 'u' as vowels).

 

String Methods and Debugging

Wiki array02.jpg


Solution

I still have to do the solution write-up...

Code

Solution Code

Back to the Program-A-Day homepage