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
Bess [88]
3 years ago
13

Write a function that counts and returns the number of vowels in the input, up to the next newline or until the input is done, w

hichever comes first. Your function should have the following prototype:
int count_vowels();
Computers and Technology
1 answer:
Valentin [98]3 years ago
3 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// function that return the number of vowels in the input string

int count_vowels()

{

// variable

   string str;

   int v_count=0;

   cout<<"enter the string:";

   // read the string

   cin>>str;

   // fuind the length

   int len=str.length();

   // check for vowel

   for(int x=0;x<len;x++)

   {

       char ch=str[x];

       if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'|ch=='U')

       {

           v_count++;

       }

   }

   // return the count

   return v_count;

}

// driver function

int main() {

// call the function and print the result

cout<<"number of vowels in string is : "<< count_vowels()<<endl;

return 0;

}

Explanation:

In the function count_vowels(), read a sting and then find its length.Then check each character of the string is vowel or not.If it is vowel then Increment the v_count. After the loop return the count to main function and print it.

Output:

enter the string: welcometoprogramming

number of vowels in string is : 7

You might be interested in
Which of the following subject lines would be best to use when applying for a position in a high school teacher
mel-nik [20]

Answer:

option d

Explanation:

Subject line should be short but descriptive. Whenever a person reads a subject, he/she should know what the application is all about. In the question, the application is all about applying for a school teacher so subject must contain words for teacher.

7 0
3 years ago
What is sexual intercourse <br><br>​
n200080 [17]

Answer:

immmm ....

I know the answer but I won't tell..lolllll

7 0
3 years ago
Read 2 more answers
In cell I5, enter a formula to calculate the total admission fees collected for the 2018
V125BC [204]
The formula is to calculate the total admission fees collected is = F5*B14

1. Click on cell I5
2. Type equal sign =
3. Type F5 or click on F5 cell
3. Type multiplication sign *
4. Type B14 or click on B14 cell
4 0
3 years ago
Read 2 more answers
What is output by the following code?
Naily [24]

Answer:

Sum = 3

Sum = 9

Sum = 18

Sum = 30

Look at the image for more information.

4 0
2 years ago
Jeffery wants to identify the subject terms being used in APA PsychInfo for articles related to behavior modifications. What is
schepotkina [342]

Group of answer choices.

a. He can look for common related subject terms in a dictionary, thesaurus or encyclopedia.

b. He can look for relevant articles in the results list from a database search and scan the subject terms.

c. He can use Go-ogle Scholar to retrieve relevant articles and find common related subject terms.

Answer:

b. He can look for relevant articles in the results list from a database search and scan the subject terms.

Explanation:

A Search engine is an internet resource or service that searches for keywords or categories specified by the end user and then displays (shows) a list of website which matches or have informations similar to the query. Some examples of popular search engines are Goo-gle, Bing, Yahoo, etc.

The most efficient and effective search strategy to identify subject terms for a database search is to look for relevant articles in the results list from a database search and scan the subject terms.

In order to improve the speed of retrieval for a search engine, high frequency words such as if, or, and, at, to, etc., which are generally referred to as stop words are filtered out.

However, AND should be used to combine keywords and phrases when using a "subject search" option to search a database for relevant articles.

5 0
3 years ago
Other questions:
  • A Pool charges $4 each visit,or you can buy a membership. Write and solve an inequality to find how many times a person should u
    5·1 answer
  • Okay so, not really a question but whatever it’s been bothering me.
    9·2 answers
  • Differentiate between third and fourth generation of computer​
    6·1 answer
  • How does adding additional light bulbs affect a series circuit?
    10·1 answer
  • _______ allows you to specify how a photo is positioned in the text of your document.
    11·1 answer
  • You open the home page for www.alpineskihouse. On the home page, you see a link for the weather report. You want to view the wea
    6·1 answer
  • Select the true statement from the choices below. Group of answer choices Invalid code may cause browsers to render the pages sl
    11·1 answer
  • This is for career exploration, I need help please! &lt;3 HELPPPP
    8·2 answers
  • While developing a network application, a programmer adds functionally that allows her to access the running program without aut
    14·1 answer
  • A major public university graduates approximately 10,000 students per year, and its development office has decided to build a We
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!