Vowel Capitalization

Open a file specified by the user. Read in each line from the file, one at a time. Then use charAt() and a loop to process that line one character at a time.

If the character is a consonant, simply display it as-is on the screen. If the character is a lower-case vowel (a,e,i,o,u), display it as a CAPITAL LETTER instead. This is going to take some if statements.

You can try the sample input file vowels.txt to see what your program does. You could also test it on any other file you like.

Open which file: vowels.txt

Old McDOnAld hAd A fArm; E-I-E-I-O.  (And dOn't fOrgEt 'U'.)
ABCDEFGHIJKLMNOPQRSTUVWXYZ
^bcd^fgh^jklmn^pqrst^vwxyz

 

Open which file: letter.txt

+---------------------------------------------------------+
|                                                    #### |
|                                                    #### |
|                                                    #### |
|                                                         |
|                                                         |
|                              BIll GAtEs                 |
|                              101 MIcrOsOft WAy          |
|                              REdmOnd, WA 78641          |
|                                                         |
+---------------------------------------------------------+


©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License