Answer:
import java.util.ArrayList;
import java.util.List;
public class Vowels {
public static void main(String[] args) {
String word = "I am David from Nigeria";
System.out.println(which_vowels_present(word));
}
public static List which_vowels_present(String enteredWord){
List<Character>list = new ArrayList<>();
String word = enteredWord.toLowerCase();
for (int i =0; i<word.length(); i++){
if (word.charAt(i) == 'a' || word.charAt(i) == 'e' || word.charAt(i) == 'i'
|| word.charAt(i) == 'o' || word.charAt(i) == 'u') {
list.add(word.charAt(i));
}
}
return list;
}
}
Explanation:
- Using Java programming Language
- Import java.util.ArrayList; and java.util.List
- Create the method which_vowels_present which accepts a string parameter
- Within the method create a list object
- Use a for loop to iterate the string. within the for loop use an if statement to check individual characters of the string if any is a vowel, add it to the list
- return the list
- In the main method, create a test string, call the method and pass the string as parameter
Basic Input-Output System
1. The best option is C) pick an object at random, and keep track of how many copies of an object are left in a game.
2. The best option is D) clockwise and counterclockwise.
3. your 3rd question does not seem to be clear to me.
Press sign up and put your information in there. Then it should automatically make your profile.
Answer: 1 what do u think to help u