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
To create a formula, click the cell where you want to add the formula and press the _____ key.
Ipatiy [6.2K]
C........is the answer
4 0
3 years ago
Read 2 more answers
Tablets combine the features of which two types of devices?
VikaD [51]
A tablet<span> is a wireless, portable personal computer with a touchscreen interface. The </span>tablet<span> form factor is typically smaller than a notebook computer, but larger than a smartphone.
</span>
5 0
2 years ago
Samantha is in the beginning stages of OOP program development. What are the five steps she must follow for creating an OOP prog
lora16 [44]

Answer:

1. Classes and objects

2. Inheritance

3. Polymorphism

4. Data hiding/ encapsulation

5. Interfaces.

Explanation:

Classes and objects depict the major component of the OOP (object oriented programming). It explains the object like a ball in a soccer game development.

The inheritance is like the subclass of the object. Data hiding is a stage in oop where the codes or data are hidden from another users.

In the polymorphism stage, the object is given the ability to change to a sub-object, while in the interface stage a function or method signature is defined without implementing it.

3 0
3 years ago
Read 2 more answers
) Briefly describe the purpose of the DASH protocol in streaming videos.
Dennis_Churaev [7]

Answer:

The purpose of the DASH protocol in the streaming videos are that it provide the high quality for the streaming media content from the HTTP servers.

DASH stands for the dynamic streaming over HTTP and it is a standard for the steaming over the HTTP that has potential for replacing the various technology. It is basically produces various on demand resources file depending upon the processing power and the bandwidth of the delivery to the clients.

3 0
3 years ago
List four examples of soft and hard skills
emmainna [20.7K]

Answer:

Explanation:

soft skills

1 – Communication. ...

2 – Teamwork. ...

3 – Adaptability. ...

4 – Problem-Solving. ...

hard skills

Technical Skills

Computer Skills

Analytical Skills

Marketing Skills

8 0
2 years ago
Read 2 more answers
Other questions:
  • In Linux Operating System, what file extension is used forexecutable files?
    6·1 answer
  • _ includes websites that encourage interaction and connection among people, businesses, and organizations.
    5·1 answer
  • What is an apprenticeship
    7·1 answer
  • How might the website owner use theses details other than to verify login details?
    6·2 answers
  • The image below shows a weather service map
    13·1 answer
  • 4
    12·2 answers
  • What is the most efficient<br> form of transportation we<br> have?
    13·2 answers
  • Which of the following is not a benefit of introducing an e-commerce solution to an organisation?
    14·1 answer
  • ________________, _______________ and ___________ are what you see when you open Excel
    14·2 answers
  • a matched-pairs t-test is not an appropriate way to analyze data consisting of which of the following?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!