Question: Write a Java program that asks the user a sentence: word1 word2 words. WOTE Your prompts to the user must be: Enter four works: Output
Write a Java program that asks the user a sentence: word1 word2 words. WOTE Your prompts to the user must be: Enter four works: Output word1 and the length of word1 and the position of all the vowels (a, e, 1, 0, ) in wom toiu) in word1 Output word2 and the length of word2 and the position of all the vowels (a, e, i, o, u) in words Output word3 and the length of word3 and the position of all the vowels (a, e,1,0,0) in wom Output word4 and the length of word4 and the position of all the vowels (a, e, i, o, u) in Wom Sample runs would look like: -1 Enter 4 words: she smiles third frisbee Word 1 = "she" Length - 3 position of vowels al. -1. 2.1 Word 2 = "smiles" Length - 6 position of vowels 'a' .1. - 4 Word 3 = "third" Length - 5 position of vowels: a = -1, -1, Word 4 - "frisbee Length - 7 position of vowels: -1, tel. 5. 1 1 -1, - 2 -2, 2. -1, U OP -1. -1, -1 1 1 -1 U or Enter 4 words: shoe shoe chime wallabees Word 1 - "shoe Length - 4 position of vowels: 'a' - -1, "el - 3, '1' = -1, "O' = 2, 'U' --1 Word 2 - "shoe" Length - 4 position of vowels: 'a' - -1, 'e' - 3, 'i' - -1, "O' - 2, 'u' = -1 Word 3 = "chime Length = 5 position of vowels: 'a' = -1, 'e' = 4, "i' - 2, 'O' - -1, "'--1 Word 4 - "wallabees" Length - 9 position of vowels: a' 1. Tel 6, 1 -1, O -1. U = -1 Please make sure to end each line of output with a newline. Note: If there are multiple instances of the same vowel, only the index of the first occurrence should be used Please note that your class should be named Words. -minn Methods I by
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
