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
Declare k, d, and s so that they can store an integer, a real number, and a small word (under 10 characters). Use these variable
Svetradugi [14.3K]

Answer:

int k;

double d;

char s[10];

cin >> k >> d >> s;

cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s;

Explanation

First Step (declare K, d, s) so they can store a integer

int k;

double d;

char s[10];

Second Step (read in an integer, a real number and a small word)

cin >> k >> d >> s;

Third Step ( print them out )

cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s;

5 0
3 years ago
Computers are classified by price, processing speed, capacity, and
Anarel [89]
C. decade in which they were designed
4 0
4 years ago
As you're helping a user configure her e-mail over the phone, she remarks that the IP address is different than it was when she
WINSTONCH [101]

Answer:

D. Her computer is a DHCP client.

Explanation:

Since in the question it is mentioned that IP address is different as compared in the previous week also the user did not make any changes with respect to the TCP/IP configuration and the system is working well

So this situation represents that the user computer is a client of DHCP as it deals with the client-server protocol in which it automatically generates the IP i.e Internet protocol along with the IP address

Hence, the correct option is d.

4 0
4 years ago
____ arguments may provide more control over the returned value.
OLga [1]
D. Absolute is the answer
3 0
4 years ago
A person gets 13 cards of a deck. Let us call for simplicity the types of cards by 1,2,3,4. In How many ways can we choose 13 ca
natima [27]

Answer:

There are 5,598,527,220 ways to choose <em>5</em> cards of type 1, <em>4 </em>cards<em> </em>of type 2, <em>2</em> cards of type 3 and <em>2</em> cards of type 4 from a set of 13 cards.

Explanation:

The <em>crucial point</em> of this problem is to understand the possible ways of choosing any type of card from the 13-card deck.

This is a problem of <em>combination</em> since the order of choosing them does not matter here, that is, the important fact is the number of cards of type 1, 2, 3 or 4 we can get, no matter the order that they appear after choosing them.

So, the question for each type of card that we need to answer here is, how many ways are there of choosing 5 cards of type 1, 4 cards of type 2, 2 cards of type 3 and 2 are of type 4 from the deck of 13 cards?

The mathematical formula for <em>combinations</em> is \\ \frac{n!}{(n-k)!k!}, where <em>n</em> is the total of elements available and <em>k </em>is the size of a selection of <em>k</em> elements  from which we can choose from the total <em>n</em>.

Then,

Choosing 5 cards of type 1 from a 13-card deck:

\frac{n!}{(n-k)!k!} = \frac{13!}{(13-5)!5!} = \frac{13*12*11*10*9*8!}{8!*5!} = \frac{13*12*11*10*9}{5*4*3*2*1} = 1,287, since \\ \frac{8!}{8!} = 1.

Choosing 4 cards of type 2 from a 13-card deck:

\\ \frac{n!}{(n-k)!k!} = \frac{13!}{(13-4)!4!} = \frac{13*12*11*10*9!}{9!4!} = \frac{13*12*11*10}{4!}= 715, since \\ \frac{9!}{9!} = 1.

Choosing 2 cards of type 3 from a 13-card deck:

\\ \frac{n!}{(n-k)!k!} =\frac{13!}{(13-2)!2!} = \frac{13*12*11!}{11!2!} = \frac{13*12}{2!} = 78, since \\ \frac{11!}{11!}=1.

Choosing 2 cards of type 4 from a 13-card deck:

It is the same answer of the previous result, since

\\ \frac{n!}{(n-k)!k!} = \frac{13!}{(13-2)!2!} = 78.

We still need to make use of the <em>Multiplication Principle</em> to get the final result, that is, the ways of having 5 cards of type 1, 4 cards of type 2, 2 cards of type 3 and 2 cards of type 4 is the multiplication of each case already obtained.

So, the answer about how many ways can we choose 13 cards so that there are 5 of type 1, there are 4 of type 2, there are 2 of type 3 and there are 2 of type 4 is:

1287 * 715 * 78 * 78 = 5,598,527,220 ways of doing that (or almost 6 thousand million ways).

In other words, there are 1287 ways of choosing 5 cards of type 1 from a set of 13 cards, 715 ways of choosing 4 cards of type 2 from a set of 13 cards and 78 ways of choosing 2 cards of type 3 and 2 cards of type 4, respectively, but having all these events at once is the <em>multiplication</em> of all them.

5 0
4 years ago
Other questions:
  • Write a static method, getBigWords, that gets a single String parameter and returns an array whose elements are the words in the
    15·1 answer
  • A derived character that is shared by all members of a clade is called a ______________ of that clade.
    6·1 answer
  • Four parts of the compuet mouse​
    6·1 answer
  • Select each item that represents what the Internet may be used for:
    9·1 answer
  • Which type of operating system is usually used in personal computers
    13·1 answer
  • failure of the _ cylinder will often result in sudden unexpected loss of the ability to stop the vehicle
    10·1 answer
  • Which is a benefit of getting information from a government website?
    15·2 answers
  • Please help me please help me.​
    10·1 answer
  • For each situation, provide a pseudocoded algorithm that would accomplish the task. Make sure to indent where appropriate.Situat
    10·1 answer
  • Please help me!! (two questions)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!