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
Choose the correct item. Check your answers in the text.<br>3​
RSB [31]

Answer:

You should do that

Explanation:

You didnt say anything

5 0
3 years ago
The physical components of a computer, such as a keyboard or hard drive, is called?
faust18 [17]

I'm assuming hardware.


Remember, Hard = Physical.


If that's not it, try peripherals.

4 0
4 years ago
After installing the processor, if the system begins the boot process and suddenly turns off before completing the boot, the pro
NikAS [45]

Answer:

A. True

Explanation:

Be sure your processor is receiving sufficient cooling by verifying if there is a heatsink on it. If there is, make sure that it's inserted fully into cpu_fan port on the motherboard. If the boot process still turns off, you may have a defective processor or replace the motherboard.

8 0
4 years ago
In Joan Woodward's study of the relationship between technology and structure, the structure that was the most technically compl
Arturiano [62]

Answer:

<em>Continuous Process Production</em>

Explanation:

In a study on the relationship between  industrial structure and performance, conducted by <em>Joan Woodward</em> from 1950 to 1959,  

she classified technology into <em>three groups</em>:  

  1. <em>Small batch and Unit technology  </em>
  2. <em>Large batch and Mass production </em>
  3. <em>Continuous process production </em>

She came to a  conclusion that the <em>continuous process production was the most complex</em> and  unit technology as the least.

4 0
3 years ago
Use the commands you've learned so far to draw a
Murrr4er [49]

The app you shown in the picture is that app scracth?

8 0
3 years ago
Other questions:
  • #A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every
    5·1 answer
  • What are smart mobile devices
    11·1 answer
  • Can you list one property of each of the following?<br> Excel<br> Word<br> Powerpoint
    7·2 answers
  • Samuel wanted to paste the value and the formula attached from cell B6 to cell F16. Which methods will work? Check all that appl
    5·2 answers
  • Create a class called Fraction. Provide a constructor that takes 2 integers. Provide methods for:
    8·1 answer
  • Write a program named Deviations.java that creates an array with the deviations from average of another array. The main() method
    8·1 answer
  • Which technology concept uses computer resources from multiple locations to solve a common problem?
    13·1 answer
  • Global address list characteristics
    11·1 answer
  • What do people in the movie e.t think about the character E.T
    9·1 answer
  • It would be at least two decades before some of
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!