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
Fynjy0 [20]
4 years ago
6

Write a program that prompts the user to input a sequence of characters and outputs the number of vowels.(Use the function isVow

el written in Programming Exercise 2.)Your output should look like the following:There are # vowels in this sentence.... where # is the number of vowels.here is what i have so far:#include #include using namespace std;//functions declaredbool isVowel(char ch);int main (){string letters;int num = 0;int len;cout<<"Enter a sequence of characters: ";getline(cin, letters);len = letters.length();for (int i = 0; i < len; i++){if (isVowel(letters[i]))num++;}if (num == 0)cout << "There were 0 vowels.\n";else if (num == 1)cout << "There was 1 vowel.\n";elsecout << "There were " << num << " vowels.\n";//this keeps the prompt console from closingsystem ("pause");// this adds butter to the potatoesreturn 0;}// closing main function// function to identify vowelsbool isVowel(char ch){// make it lower case so we don't have to compare// to both 'a' and 'A', 'e' and 'E', etc.char ch2 = tolower(ch);if (ch2 == 'a' || ch2 == 'e' || ch2 == 'i' || ch2 == 'o' || ch2 == 'u')return true;elsereturn false;}

Engineering
1 answer:
NISA [10]4 years ago
6 0

Answer:

This is the code:

Explanation:

count_vowels.cpp

#include <iostream>

#include <string>

using namespace std;

//functions declared

bool isVowel(char ch);

int main ()

{

  string letters;

  int num = 0;

  int len;

  cout<<"Enter a sequence of characters: ";

  getline(cin, letters);

  len = letters.length();

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

  {

      if (isVowel(letters[i]))

          num++;

  }

  cout << "There are "<<num<<" vowels in this sentence."<<endl;

  //this keeps the prompt console from closing

  system ("pause");

  // this adds butter to the potatoes

  return 0;

}// closing main function

// function to identify vowels

bool isVowel(char ch)

{

// make it lower case so we don't have to compare

// to both 'a' and 'A', 'e' and 'E', etc.

char ch2 = tolower(ch);

return ch2 == 'a' || ch2 == 'e' || ch2 == 'i' || ch2 == 'o' || ch2 == 'u';

}

You might be interested in
What are the functions of a gear
iogann1982 [59]
It’s engineering gnzvxhfhbkchufkh
6 0
3 years ago
Read 2 more answers
You are the project manager assigned to construct a new 10-story office building. You are trying to estimate the costs for this
Semmy [17]

Answer:

Bottom-up Estimation

Explanation:

Bottom-up estimation is a type of project cost estimation that considers the cost of individual project activities and finally sums them up or finds the aggregates. The summation gives an idea of what the entire project will cost.

This is an effective way of estimating the cost of a project as it evaluates the costs on a wholistic basis. It also considers the tiniest details during the estimation process. The process moves from the simpler details to the more complicated details.

8 0
3 years ago
An escalator in a shopping center is designed to move 50 people, 75 kg each, at a constant speed of 0.6 m/s at 450 slope. Determ
REY [17]

Answer:

Power required to drive the escalator shall be equal to the rate at which the energies of the persons is increased.

Energy=n\times mass\times g\times h\\\\\therefore Power=n\times mass\times g\times \frac{dh}{dt}\\\\Power=50\times 75\times 9.81\times 0.6sin(45)\\\\Power=15.607kW

As we infer from the above equation If the velocity of the escalator is doubled then the Power required will also be doubled and become 31.215kW

3 0
4 years ago
While discussing VIN numbers, Technician A says that the first digit of the VIN identifies the country where the vehicle was man
ruslelena [56]
Usually the first digit of the vin id’s the country it was built. So technician A would be correct. That’s usually how it is. Hope this helps. Please let me know if this is incorrect
4 0
3 years ago
When all conductors of the same alternating-current circuit are in the same raceway, the magnetic flux around each conductor flu
LuckyWell [14K]

Answer:

B. Cancels out

8 0
4 years ago
Read 2 more answers
Other questions:
  • A vacuum gauge indicates that the pressure of air in a closed chamber is 02 bar ( vacuum) The pressure of the surrounding atmosp
    10·1 answer
  • WILL AWARD BRAINLIEST
    15·1 answer
  • How do we measure mass
    5·1 answer
  • You live on a street that runs East to West. You just had 2 inche of snow and you live on the North side of the street. You retu
    14·1 answer
  • Disk A has a mass of 8 kg and an initial angular velocity of 360 rpm clockwise; disk B has a mass of 3.5 kg and is initially at
    5·2 answers
  • Wattage is:
    9·1 answer
  • In engineering economic analysis, it is permissible to sum dollar amounts without conversion only when __________ .
    5·1 answer
  • What is your opinion on environmental art? Do you consider it art? What about the trans-species art you read about? Do you think
    9·2 answers
  • Horizontal shear forces and, consequently, horizontal shear stresses are caused in a flexural member at those locations where th
    6·1 answer
  • You have just started a new job and your poss gives you a list of chemicals you
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!