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]
3 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]3 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
Which of the following refers to a full-scale version of a product used to validate performance?
kompoz [17]
I’m thinking it would be c sorry if it’s wrong .
4 0
2 years ago
Read 2 more answers
A _____ satellite system employs many satellites that are spaced so that, from any point on the Earth at any time, at least one
Wittaler [7]

Answer:

d. low earth orbit (LEO)

Explanation:

This type of satellites form a constellation deployed as a series of “necklaces” in such a way that at any time, at least one satellite is visible by a receiver antenna, compensating the movement due to the earth rotation.

Opposite to that, a geostationary satellite is at an altitude that makes it  like a fixed point over the Earth´s equator, rotating synchronously with the Earth, so it is always visible in a given area.

3 0
2 years ago
Why is concrete on its own not a good material to use
Inga [223]

Answer:

It has poor tensile strength despite having high compressive strength

Explanation:

Concrete exhibits high compressive strength when used. However, it has very low compressive strength. This is the reason why concrete is normally combined with steel to make a composite building material called reinforced concrete. The steel reinforces concrete hence increasing the tensile strength in RC buildings. The end composite is durable and fireproof. Generally, the main reason why concrete is not use on its own is due to its poor tensile strength.

7 0
2 years ago
A closed, rigid tank is lled with a gas modeled as an ideal gas, initially at 27°C and a gage pressure of 300 kPa. The gas is he
sergejj [24]

Answer:

T₂ =93.77  °C

Explanation:

Initial temperature ,T₁ =27°C= 273 +27 = 300 K

We know that

Absolute pressure = Gauge pressure + Atmospheric pressure

Initial pressure ,P₁ = 300+1=301 kPa

Final pressure  ,P₂= 367+1 = 368  kPa

Lets take  temperature=T₂

We know that ,If the volume of the gas is constant ,then we can say that

\dfrac{P_2}{P_1}=\dfrac{T_2}{T_1}

{T_2}=T_1\times \dfrac{P_2}{P_1}

Now by putting the values in the above equation we get

{T_2}=300\times \dfrac{368}{301}\ K

The temperature in  °C

T₂ = 366.77 - 273  °C

T₂ =93.77  °C

8 0
3 years ago
Why might construction crews want to install pipes before the foundation is poured
Crazy boy [7]

The answer is choice C

Explanation:

As during construction ,the site is cleared for all debris before laying out the foundation. Even the sewer lines are dug out .

So it will be useful for the construction crews to  connect the pipes to the sewer lines before the foundation is poured.

But usually the steps take in construction activity is:- first the site is cleared for the foundation to be poured  and once the foundation wall is set , then all utilities , including plumbing and electrical activities are done.,

After this process is over, the city inspector comes to check whether the foundation has been laid down as per the code of construction.

Only after that the rest of the construction activity follows through.

3 0
3 years ago
Other questions:
  • An alloy has a yield strength of 818 MPa and an elastic modulus of 104 GPa. Calculate the modulus of resilience for this alloy [
    13·1 answer
  • Is the ASUS ROG Strix B450-F Gaming amd ryzen 5 3600 ready?
    7·2 answers
  • A hollow aluminum sphere, with an electrical heater in the center, is used in tests to determine the thermal conductivity of ins
    14·2 answers
  • The pressure in an automobile tire depends on thetemperature of the air in the tire. When the air temperature is25°C, the pressu
    11·1 answer
  • WHEN WAS THE FIRST CAR INVENTED?
    13·2 answers
  • Determine the design angle ϕ (0∘≤ϕ≤90 ∘) between struts AB and AC so that the 400 lb horizontal force has a component of 600 lb
    10·1 answer
  • Andy is a carpenter and wants to make various articles using engineered wood. Which of these wood types can he use?
    8·2 answers
  • Why is communication one of the most important aspects of an engineer's job?
    12·1 answer
  • 1)What are the three previous manufacturing revolutions Mr. Scalabre mentions? When did these take place?
    6·1 answer
  • Which level of acceleration should you use when accelerating on a short highway entry ramp?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!