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
jok3333 [9.3K]
3 years ago
12

Your program will read a word (or a whole line) from the user. It will then count the number of vowels in the word (or line) and

print put this value. You should ignore the semi-vowel y since determining its role requires dividing words into syllables which is hard to do in English. The program should end when the word END is entered. Example Input and Output: Enter a word: Vowel The word Vowel contains 2 vowels. Enter a word: determining The word determining contains 4 vowels. Enter a word: WILL The word WILL contains 1 vowel. Enter a word: END
Computers and Technology
1 answer:
Softa [21]3 years ago
4 0

Answer:

Following are the program in the Python Programming Language.

def vowel(): #define function

 print("Enter END to Break") #print message

 while(True): #set while loop

   word=input("Enter words: ") #get input from the user

   count=0 #set count to 0

   if(word=="END"): #set if condition

     break #terminate the loop

   else:

     for i in range(len(word)): #set the for loop

       c=word[i] #initialize in c

       if(c=='a'or c=='e' or c=='i'or c=='o'or c=='u'or c=='A'or c=='E'or c=='I'or c=='O'or c=='U'):

         count+=1 #increament in count by 1

     print("The word " , word , " contains " , count, end=" ")#print message

     if(count==1):#check condition

       print("vowel.")

     else:

       print("vowels")

#call the function

vowel()

Output:

Enter END to Break

Enter words: Vowel

The word  Vowel  contains  2 vowels

Enter words: END

Explanation:

Here, we define a function "vowel()" inside it.

  • Print message for the user.
  • Set the while loop and pass condition is True then, get input from the user in the variable "word" then, set variable "count" and initialize to 0.
  • Set if condition to check if the user input "END" then, the loop will terminate.
  • Otherwise, set for loop which continues from the length of the word.
  • Then, we set if statement which checks the vowel in the word, then increment in count by 1.
  • Print the message in the following format which is mentioned in the question.
  • Then, set if-else statement for check count is equal to 1 then print "vowel." Otherwise, it prints "vowels."

Finally, we call the following function "vowel()".

You might be interested in
Write a complete function called lowestPosition() which takes as array (of double) and the number of elements used in the array
stiv31 [10]

Answer:

#include <bits/stdc++.h>

using namespace std;

int lowestPosition(double elements[],int n)//function to find position of lowest value element.

{

   int i,pos;

   double min=INT_MAX;

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

   {

       if(elements[i]<min)

       {

           min=elements[i];

           pos=i;//storing index.

       }

   }

   return pos+1;//returning pos +1 to give the correct position in the array.

}

int main() {

double ele[500];

int n;

cout<<"Enter number of values"<<endl;

cin>>n;

cout<<"Enter elements"<<endl;

for(int i=0;i<n;i++)

{

   cin>>ele[i];

}

int pos=lowestPosition(ele,n);//function call.

cout<<"The position of element with minimum value is "<<pos<<endl;

return 0;

}

Output:-

Enter number of values

5

Enter elements

4 6 7 5 1

The position of element with minimum value is 5

Explanation:

I have created a function lowestPosition() with arguments double array and it's size.I have taken a integer variable pos to store the index and after finding minimum and index i am returning pos+1 just to return correct position in the array.

3 0
4 years ago
Which virus-infecting components are email messages prone to carry?
Mrac [35]

Spam Messages

Explanation:

These are messages that contain malicious codes that are usually intended to send messages to the email user's email list without his permission.

Some are easily recognized with their subject but some come in the form of useful messages.

3 0
4 years ago
Read 2 more answers
You need to put cabling for connecting two new computers in a room, which did not have any network infrastructure. Because of th
vredina [299]

Answer: Twisted pair cabling in the shielded form can be used for the mentioned situation in the question

Explanation: Twisted pair cables in shielded form are easy to make a connection .It does not create lot of noise and has reduced cross talk .It is a low weighted cable and so it can be easily attached with the ceiling tile.

The maintenance of the complete cabling is not a issue and interference is also low that fulfills the requirement of disruption-less network signal.The overall costing of the cable is also less .Thus shielded twisted pair cable are the most appropriate cable for the mentioned situation.

3 0
3 years ago
Read 2 more answers
. Which of the following is the correct syntax for a method header with parameters? a. public static void example(x, y) { b. pub
mojhsa [17]

Answer:

e.

public static void example(int x, in y)

Explanation:

The header comprises the access modifiers (public static), return type (void), method name (example), and parameters with the type of variable before the name of the parameters (int a, int b).

4 0
3 years ago
Rene has added to touches and shoulder stretches to his warm up routine these activities are most likely to improve his
pochemuha
Arm rotations is the answer I think
6 0
3 years ago
Other questions:
  • How to add a second screen to your computer?
    7·1 answer
  • Input numbers and segregate them by placing their values into even or odd vectors based upon their value being even or odd. Then
    12·1 answer
  • One factor affecting digital camera quality is the number of pixels, measured in ____, used to store the data for each image.
    8·2 answers
  • Text messaging is an example of nonverbal communication. Please select the best answer from the choices provided. T F
    7·2 answers
  • Where should i go if i want to begin learning how to code a video game. What are your recommendations to a 16 yr old to learn co
    13·1 answer
  • Contrast the performance of the three techniques for allocating disk blocks (contiguous, linked, and indexed) for both sequentia
    13·1 answer
  • Who like the videos where is clown is from :)
    6·1 answer
  • Antwon is building his technical writing portfolio.He created the following checklist: •check whether any part of the portfolio
    11·1 answer
  • HELP ASAP IF YOU KNOW PYTHON 2!!!
    15·1 answer
  • Which of the following describes why graphical interfaces quickly became popular after their introduction to the mass market?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!