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
1. ____________notes that can be attached to cells to add additional information that is not printed on the worksheet network dr
Anna71 [15]

1. <u>Comments</u> notes that can be attached to cells to add additional information that is not printed on the worksheet network drive.

2. <u>Footer</u> text and/or graphics that print at the bottom of each page headers.

3. <u>Headers</u> text and/or graphics that print at the top of each page rows.

4. <u>Margins</u> the white space left around the edges of the paper when a worksheet is printed comments.

5. <u>Network drive</u> location at a workplace for storing computer files footer.

6. <u>Rows</u> go across (horizontal) margins.

7. <u>Template</u> a file format used to create new files that contain the same data as the template.

<u>Explanation:</u>

On the off chance that you need to add a header or footer to all sheets, select each sheet by right-clicking one of the sheet tabs at the base of the Excel screen and clicking "Select All Sheets" in the spring up menu. It's genuinely basic to put an Excel header on all pages of all worksheets in your record.

A header is a line of content that shows up at the highest point of each page of a printed worksheet. You can change the direction of a worksheet, which is the situation of the substance with the goal that it prints either vertically or on a level plane on a page.

6 0
4 years ago
Supports traditional transactional processing for day-to-day front-office operations or systems that deal directly with the cust
Jet001 [13]

Answer:

Operational CRM.

Explanation:

Operational CRM can be described as most of the programs that allow a company to taking care of the desires of the consumers. The structure links and maintains the selling, marketing, and customer support activities of a corporation, thus providing a structure that requires customer service.

So, the following answer is correct according to the statement.

7 0
4 years ago
What is the processing speed for the second generation of computers​
natima [27]

Answer:

10mbps

Explanation:

that's what the internet says

5 0
3 years ago
What are some of the unique benefits and challenges of flash drives as a way to store data?
Charra [1.4K]

Answer:

these are some benefits Increased Durability. Unlike traditional hard-disk drives, flash drives lack moving parts

Maximum Portability

Plenty of Storage Capacity

Fast Transfer Speeds

Compatibility with Many Devices

7 0
4 years ago
What defines "print media"? It is media that includes words and text rather than video, such as many blogs. It is media that is
uranmaximum [27]

Answer:

"It is media that is distributed in paper form, such as magazines and newspapers."

3 0
3 years ago
Other questions:
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • Robert brought 10 shares apex company for $18 each and later sold all of them at $17 each. This transaction resulted in what typ
    8·2 answers
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • Create a GUI application that allows the user to select a rate category (from a set of radio buttons), and enter the number of m
    6·1 answer
  • If you can log into a website to add, edit, or delete content that has been added by you or another user, you are most likely us
    6·1 answer
  • Identify a true statement about a flat file system. a. Data in a flat file system can be updated efficiently. b. Data in a flat
    9·1 answer
  • Which tag defines the visible content of a web document?
    10·1 answer
  • Let T be the statement: The sum of any two rational numbers is rational. Then T is true, but the following "proof is incorrect.
    14·1 answer
  • Susan's monthly goal to open five new customer
    10·1 answer
  • List how much hard disk capacity you recommend, and write a sentence explaining why.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!