EggyPeggy Program
Description
This program inputs a string and adds the word “egg” in front of every vowel in a string.Associated Concepts:
StringBuilder
Algorithm:
main method:
Method eggIt definition
Input a string from the keyboard
Call eggIt method and pass the string as the argument
Print the result
Call eggIt method and pass the string as the argument
Print the result
Method eggIt definition
Create a StringBuilder object based on the input string
Loop: go through each letter in the StringBuilder object
Retrieve the letter at index i
If the letter is a vowel
Insert "egg" in front of it
Return the result
Loop: go through each letter in the StringBuilder object
Retrieve the letter at index i
If the letter is a vowel
Insert "egg" in front of it
Return the result