Algorithm for Programming Task #2
Step 1: Prompt the user for a word
Step 2: Determine and Display the number of vowels are in the word the user inputted
Step 3: After, showing the user the number of vowels in their word, the program will prompt them a yes or no, to try again, if yes it will run again and if no it will close.
Input:
Variables:
Process:
Output:
Step 2: Determine and Display the number of vowels are in the word the user inputted
Step 3: After, showing the user the number of vowels in their word, the program will prompt them a yes or no, to try again, if yes it will run again and if no it will close.
Input:
- User's input of a word
- User's input for their choice (Yes/No)
- And then User's input of a word again...
Variables:
- String word (User's Inputted word)
- int counter (Counts the number of vowels)
- int counter2 (Helps the "for"statement when finding the vowels in the user's word)
- char numv (Helps pin-point where each vowel is)
- char ans (user's input Yes or No)
Process:
- Get the word and assign/store it to a variable
- Declare an int variable as counter = 0, add 1 to it for every vowel
- Declare an int variable as counter2 = 0, in the "for" loop statement
- Declare a char variable as numv, and use the "charAt" to for the vowels
- Declare a char variable as ans and use a "if" statement for the user choice
Output:
- Prompt user for a word
- Show user the number of vowels in that word
- Prompt user for an answer (If yes, prompt user for a word again) (If no, the program will close)