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
Wewaii [24]
3 years ago
14

#Write a function called has_a_vowel. has_a_vowel should have #one parameter, a string. It should return True if the string #has

any vowels in it, False if it does not.
Computers and Technology
1 answer:
Vladimir [108]3 years ago
8 0

Answer:

Here is code in java.

import java.util.*;

class Main

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // scanner object to read input from user

       Scanner obj=new Scanner(System.in);

       System.out.println("please enter a string:");

       //read the string input

       String inp=obj.next();

       // call the function to check whether string has vowel or not

       Boolean res=has_a_vowel(inp);

       // printing the result

       System.out.println("string contains vowel."+res);

     

       

   }catch(Exception ex){

       return;}

}

 // method to check string has vowel or not

public static boolean has_a_vowel(String str)

{

 // find length of the string

    int len=str.length();

   

    Boolean flag=false;

     int i;

    for( i=0;i<len;i++)

    {

        char chh=str.charAt(i);

         // if string contains vowel then flag will be true

        if(chh=='a'||chh=='e'||chh=='i'||chh=='o'||chh=='u')

        {

            flag=true;

            break;

        }

    }

     //returning the result

    return flag;

}

}

Explanation:

Create a scanner class object to read the string and assign it to variable

"inp".Call the function "has_a_vowel" with a string parameter.In this function

find the length of string and travers the string.If there is any vowel character

in the string then flag will be set to true otherwise flag will be false. Then it will

return the value of flag.We can test the function from the main by passing a string parameter.

Output:

please enter a string:                                                                                                                                        

vjcavcavacvajjfd                                                                                                                                              

string contains vowel:true

please enter a string:                                                                                                                                        

sdfdhgjkhltyrqwzxcvbmm                                                                                                                                        

string contains vowel: false                                                                                                                                  

                             

You might be interested in
Why do we need multitasking functionality in an Operating System?
Leokris [45]

Answer:

Multitasking is a process in which we do multiple task at a time.    

In computing system, multitasking is the concept of performing different types of multiple task and process over a certain period of time by executing simultaneously.

Operating system basically allow various task to run simultaneously by the user. In an operating system, each task consume storage system and all the other resources.

Multitasking function facilitate memory isolation in the processor and also supported different levels of security system in the operating system. For example, "a programmer working on any program in a system and as well as listening the music then, it perform multiple task at the same time".

7 0
3 years ago
While building a high-end gaming system, you are attempting to install the EVGA GeForce GTX 1080 graphics card and discover ther
polet [3.4K]

Answer:

I will use a riser card to install the card parallel to the motherboard.

Explanation:

If you attempted to install a GPU like this and it stands tall, then this means that you do not have enough room for the card. Instead of purchasing a new case that will allow the GPU to seat comfortably, you can buy a riser card. A riser card seats at a right angular position and is built to extend a motherboard slot. I expect a motherboard that supports an EVGA GeForce GTX 1080 graphics card to support a riser card because not all boards support a riser card. Once it is installed, the card will rest on the motherboard and will rotate the GPU to seat parallel with the motherboard.

5 0
3 years ago
With whom does the success of information processing in the firm lie with?
Leno4ka [110]

Answer:

depends

Explanation:

it lies with the entire firm and its ability to utilize or process the information in the most efficient way.

3 0
2 years ago
Read 2 more answers
Congress are smart becuase.....
spin [16.1K]

Answer:

If we are talking about government then they are smart bc of there two house policies, both are equal yet super unique. They make sure each state has an equal voice in the senate.

5 0
2 years ago
What types of data sources could be used in a mail merge? Check all that apply.
krok68 [10]

<u>The types of data sources that could be used in a mail merge are:</u>

  1. Word tables
  2. a database
  3. an excel sheet
  4. an outlook contacts list

<u>Explanation:</u>

Mail merge allows one to send a particular document to different individuals.  It is generally used in office environment where some information is to be communicated  to a number of people. The information is attached by adding the data sources.

Mail merge comprises of joining mail and letters and pre-tended to envelopes or mailing names for mass mailings from a structure letter.

In database mail merging it is embedding it into reports, for example, letters, mailing marks, and unofficial IDs.

Tables assist you with exhibiting data in an unmistakable and sorted out way. Tables are helpful for different assignments, for example, introducing content data and numerical information.

In excel the component in Microsoft Word and Excel streamlines the way toward sending a similar report with customized changes to a few beneficiaries.

In outlook contacts, the wellspring of customized data in a bunch of Word reports, through Word's mail blend include through Word's mail merge feature.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Into which of these files would you paste copied information to create an integrated document? A. Mailing list B. Source C. Data
    13·2 answers
  • The parallax perspective says that objects that are close up appear to move __________ than far away objects.
    10·1 answer
  • a user has a large amount of data that she or he needs to store. the data will not be accessed regularly, but still needs to be
    5·2 answers
  • The objects that you place on master pages are called _____.
    6·1 answer
  • The ________ utility automatically creates duplicates of your libraries, desktops, contacts, and favorites to another storage lo
    6·1 answer
  • Declare an ArrayList of Strings. Add eight names to the collection. Output the Strings onto the console using the enhanced for l
    9·1 answer
  • PLSS HELP ASAP ILL GIVE BRAINLIEST THANKS
    11·1 answer
  • Does anyone know how many Brainliests you need to be able to send a private message to someone??
    10·2 answers
  • An operating system with _____ capabilities allows a user to run more than one program concurrently.
    6·1 answer
  • Question 7 (1 point)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!