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
Which of the following is a benifit of googling yourself ?
finlep [7]

Answer:

you are protecting yourself from identity theft

6 0
2 years ago
What is the most important difference between generic software product development and custom software development? What might t
Andreyy89

Answer:

In the case of generic software development, the developer has the control of all the decisions while with custom software development, the client is responsible of the decisions about the characteristics of the software.

This means for users of generic software products that they don't have control over the product.

Explanation:

-A generic software development refers to the creation of a product by a software development organization that will own it and sell it to customers. This software is created for the open market and is designed to solve a problem for many customers.

-A custom software development refers to the creation of a product by a software development organization for a client.  This product is created according to the customer's needs and specifications in order to solve a specific problem of the client.

4 0
4 years ago
over their whole lifetime about how much can someone with a professional degree expect to earn compared to someone with a highsc
Gemiola [76]

Really depends on the job most college based technology jobs pay about 100k 76k after taxes. Mechanics could range above that. Without a college degree most people don't make it above 30k. Thats not what i know for sure just of what i've seen.

4 0
4 years ago
How would you insert a section break in a document??
Ann [662]
Hit insert on the menu tab and click the type of break you want. (Line, Page, etc.)
3 0
3 years ago
In a C system, what is in a symbol table entry for a variable in addition to its name?
earnstyle [38]

Answer:

Symbol table is a data structure which is created by compiler that is used to keep the track of variable.

The symbol table contain Symbol name,Type and Scope in their table Enteries .

The symbol name is the variable name ,function name etc .

The type defined the datatype.

The scope defined the scope and visibilty of variable and function.

following are the example of symbol table

let us consider a code

int fun(int c)

{

   double  s = 0.5;

}

Now the Symbol Table for this code which is created by compiler is

Symbol name     Type                     Scope

fun                     function int            local scope

c                         int                         function parameter

s                         double                   function parameter

For  any variable in c .The symbol table store the symbol name type and scope for the variable

8 0
3 years ago
Other questions:
  • A hard drive that uses fde is often referred to as a(n) ____.
    11·1 answer
  • Which of the following was the name of the first generation of cell phone networks?
    14·1 answer
  • Which two of the following skills are important for a meteorologist
    12·1 answer
  • What are some disadvantages of using a word processor over a type writer?​
    7·1 answer
  • &gt;What is the output of the following code:
    5·1 answer
  • Why should one avoid noise in the computer room​
    12·2 answers
  • A small business utilizes a SOHO router and wishes to secure its existing wireless infrastructure. The business has fewer than t
    12·1 answer
  • What is information cycle
    15·2 answers
  • What construction work is the tender for​
    10·2 answers
  • What is the indication when a student conducting an electronic search of the literature is simultaneously using two databases, p
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!