1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ymorist [56]
3 years ago
5

The function below takes a single string parameter: sentence. Complete the function to return a list of strings indicating which

vowels (a, e, i, o, and u) are present in the provided sentence. The case of the vowels in the original sentence doesn't matter, but the should be lowercase when returned as part of the list. The order of the strings in the list doesn't matter. For example, if the provided sentence was 'All good people.', your code could return ['a', 'e', 'o']. It could also return ['e', 'o', 'a']. One way to implement this would be to use the filter pattern starting with the list of all vowels.
Computers and Technology
1 answer:
Katena32 [7]3 years ago
7 0

Answer:

import java.util.*;

public class num3 {

   public static void main(String[] args) {

   String sentence = "All good people";

       System.out.println("The vowels in the sentence are ");

       returnVowels(sentence);

   }

   public static void returnVowels(String word){

       String newWord = word.toLowerCase();

       String vowels ="";

       for (int i = 0; i < newWord.length(); i++){

           if(newWord.charAt(i)=='a'||newWord.charAt(i)=='e'||newWord.charAt(i)==i||

           newWord.charAt(i)=='o'||newWord.charAt(i)=='u'){

               vowels = vowels+newWord.charAt(i);

               //System.out.print(newWord.charAt(i)+" ");

           }

       }

     

       String [] chars = vowels.split("");

       Set<String> uniqueVowels = new LinkedHashSet<>();

       for (String s : chars) {

           uniqueVowels.add(s);

       }

       System.out.println(uniqueVowels);

   }

}

Explanation:

In Java

Create the method/function to receive a string as argument

Change the string to all small letters using the toLowerMethod

Iterate through the string using if statement identify the vowels and store in a new String

Since the sentence does not contain unique vowel characters, use the set collections in java to extract the unique vowels and print out

You might be interested in
What is the first stage of perception
Zigmanuir [339]

If we do not attend to stimuli, then we cannot perceive stimuli; thus attention is a critical factor in the process of perception. Receiving and attending to stimuli is the first stage in perception. Once we collect stimulus information from the senses, we have to try to make sense of it. This is called organization.


8 0
3 years ago
Read 2 more answers
Before attempting the​ exercise, click here to watch a short video. Of the following list of tools used at Arnold Palmer​ Hospit
Nitella [24]

Answer:

A. flowcharts

Explanation:

Flowcharts are used to graphically describes a process or​ system. They can simulate the whole process step by step showing arrows between different steps.

5 0
3 years ago
In a weighted scoring model, the sum of the weights of all the criteria must total _____ percent.
REY [17]
The answer is 100% ...
3 0
4 years ago
How to disappear completely from the internet pc magazine
GREYUIT [131]

In order to disappear completely from the internet, one needs to delete their social media accounts, delete their emails, etc.

The internet is a network of interconnected computer systems. Despite its numerous advantages, it also has several disadvantages and there are some moments when we want to disappear from the internet.

The steps that are needed to disappear from the internet include:

  • Delete your social network accounts.
  • Delete your email accounts.
  • Use search engines to track your old activities online and delete them.
  • Falsify the accounts that can't be deleted.
  • Unsubscribe from mailing lists.

Read related link on:

brainly.com/question/24902823

4 0
3 years ago
1. Write a 400-500 word research report about Burke High School.
fenix001 [56]

Answer:

when is it due

Explanation:

6 0
3 years ago
Other questions:
  • An enterprise DBMS is automatically capable of serving as a mobile DBMS. There are no special issues raised by mobility. True Fa
    11·1 answer
  • Finally, Lee wants to modify the table he linked to his presentation. How should he begin?
    8·1 answer
  • How long does it take a packet of length 1,000 bytes to propagate over a link of distance 2,500 km, propagation speed 2.5 · 108
    8·2 answers
  • 5.11 Of these two types of programs:a. I/O-boundb. CPU-boundwhich is more likely to have voluntary context switches, and which i
    9·1 answer
  • JOIN ZOOM <br> Code- 858 1417 3090 <br> Password- XvT18Q
    11·2 answers
  • A DBMS makes the: a. relational database available for different analytical views. b. physical database available for different
    12·1 answer
  • How do you check how much space is left in current drive?
    9·1 answer
  • अस्स्मन्चचरे ------------------- दृश्यते |
    8·1 answer
  • All computer systems have
    14·2 answers
  • 2 4. What is one way to prepare for building a project budget? (1 point)​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!