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
krok68 [10]
3 years ago
6

Write a function called which_vowels_present that takes a single string parameter. Complete the function to return a list of str

ings indicating which vowels (a, e, i, o, and u) are present in the provided string. The case of the vowels in the original string doesn't matter, but they should be lowercase when returned as part of the list. The order of the vowels in the list doesn't matter.
Computers and Technology
1 answer:
romanna [79]3 years ago
5 0

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

You might be interested in
This list represents the horses leading in a race: leadHorses ← ["Justify", "Bravazo", "Good Magic", "Tenfold", "Lone Sailor", "
IrinaVladis [17]

Answer:

leadHorses ← ["Justify", "Bravazo", "Good Magic", "Lone Sailor", "Tenfold",  "Sporting Chance", "Diamond King", "Quip"]

Explanation:

leadHorses ← ["Justify", "Bravazo", "Good Magic", "Tenfold", "Lone Sailor", "Sporting Chance", "Diamond King", "Quip"]

tempHorse ← leadHorses[3]

tempHorse ← Tenfold

leadHorses[3] ← leadHorses[4]

leadHorses[3] ← Lone Sailor

leadHorses[4] ← tempHorse

leadHorses[4] ← Tenfold

leadHorses ← ["Justify", "Bravazo", "Good Magic", "Lone Sailor", "Tenfold",  "Sporting Chance", "Diamond King", "Quip"]

Tenfold and Lone Sailor swap positions.

5 0
3 years ago
What is the purpose of interrupts? What is a trap? Can traps be generated intentionally by a user program? If so, for what purpo
SpyIntel [72]

Answer:

Interrupt (INT) helps operating system to stop work on one process and start work on other process using interrupt signals.

Explanation:

Purpose of interrupts:

• Interrupts are useful when an I/O device needs to be serviced only occasionally at low data transfer rate.

• For example, when a peripheral requires the attention of the processor to perform an I/ O operation.

A trap:

• also known as an exception or a fault, is typically a type of synchronous interrupt caused by an exceptional condition

• is a software-generated interrupt.

• For example it's caused by division by zero or invalid memory access.

Can traps be generated intentionally by a user program?  Yes.

If so, for what purpose?  

• the usual way to invoke a kernel routine (a system call) because those run with a higher priority than user code.  

• Handling is synchronous, so the user code is suspended and continues afterwards.

• In a sense they are active - most of the time, the code expects the trap.

3 0
4 years ago
A Google Doc automatically moves text to the next line when it reaches the right edge of the screen, is called:
DanielleElmas [232]
Word Wrap

As the name allows, the word wraps around the document once it reaches the border, thus making it the answer.

Hope this helps!
4 0
3 years ago
Read 2 more answers
The accounting department moved its network-attached printer from one side of the office to a more centralized location, making
IrinaK [193]

Answer:

The cable run connecting the new keystone jack to the patch panel is bad.

The patch panel connector for the new location's cable run is not connected to a switch.

Explanation:

7 0
3 years ago
Draw AND, OR, XOR and XNOR gates with truth table and logic gates.<br><br>.​
timofeeve [1]

Answer:

see picture. let me know if you have questions.

7 0
3 years ago
Other questions:
  • Which of the following is not a standard method called as partof the JSP life cycle?
    5·1 answer
  • Which amendment discussed in the unit do you think has the greatest effect on your life? Why?
    14·1 answer
  • Convert the Binary Number to a Decimal Number
    13·1 answer
  • Which steps would you take to determine how much an employee should be paid? Select all that apply.
    9·1 answer
  • How many electrons are there in an atom of carbon? A. Four B. Eight C. Six D. One
    15·2 answers
  • What is wrong with the following code? How should it be fixed?
    12·1 answer
  • Which tcp/ip troubleshooting command should you use to determine whether a client and server are communicating with each other?
    7·1 answer
  • Security administrator for your organization utilized a heuristic system to detect an anomaly in a desktop computer's baseline.
    7·1 answer
  • Select all the mistakes in the following: There may be more than one.
    8·1 answer
  • What is office course<br> how to learn office course
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!