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
Steam at 75 kPa and 8 percent quality is contained in a spring-loaded piston–cylinder device, as shown in Figure, with an initia
Rashid [163]

The heat transferred to and the work produced by the steam during this process  is 13781.618 kJ/kg

<h3>​How to calcultae the heat?</h3>

The Net Change in Enthalpy will be:

= m ( h2 - h1 ) = 11.216 ( 1755.405 - 566.78 ) = 13331.618 kJ/kg

Work Done (Area Under PV curve) = 1/2 x (P1 + P2) x ( V1 - V2)

= 1/2 x ( 75 + 225) x (5 - 2)

W = 450 KJ

From the First Law of Thermodynamics, Q = U + W

So, Heat Transfer = Change in Internal Energy + Work Done

= 13331.618 + 450

Q = 13781.618 kJ/kg

Learn more about heat on:

brainly.com/question/13439286

#SP1

6 0
1 year ago
What are the factors of production in business? Land, labor, and capital land, capital, and interest land, labor, and customer b
kozerog [31]

Answer:

  • <em><u> Land, labor, and capital </u></em>

Explanation:

The <em>factors of production </em>are the resources that are used to produce goods and services.

By definition resources are scarce.

<em>Land</em> includes everything that comes from the land, that can be used as raw material to produce other materials; for instance, water, minerals, wood.

<em>Labor</em>  is the work done by anybody, not just at a factory but at any enterpise that produce a good or a service. For instance, the work done by a person in a bank or a restaurant.

<em>Capital</em> is the facilites (buildings), machinery, equipments, tools that the persons use to produce goods or services. For instance, a computer, a chemical reactor, or a pencil.

Nowadays, also entrepreneurship is included as a <em>factor of production</em>, since it is the innovative skill of the entrepeneurs to combine land, labor and capital what permit the production of good and services.

6 0
3 years ago
Read 2 more answers
A large increase in elevation can cause a carbureted engine to run ________ if not properly adjusted for the altitude. a Rich b
mash [69]

Answer:

B - Poor

Explanation:

As you get higher up, There is less oxygen which causes the engine to create less power.

3 0
3 years ago
Explain how smart materials can be used by manufacturers to improve health and safety for children's products and goods.​
Ierofanga [76]

...simplify devices, reducing weight and the chance of failure.

6 0
2 years ago
Please help <br> please i need to turn this in
grigory [225]

Answer:  101 means "introductory something". The allusion is to a college course with the course code 101, which in the American system and probably others indicates an introductory course, often with no prerequisites.

Explanation:

The name Topher means Christ Bearer and is of American origin. Topher is a name that's been used primarily by parents who are considering baby names for boys. Short form of Christopher.

I am not sure but if this is a trick question then the answer lies with his name, so this is the best I got. Hope it helps!

5 0
3 years ago
Other questions:
  • A murder in a downtown office building has been widely publicized. You’re a police detective and receive a phone call from a dig
    9·2 answers
  • Consider two electrochemical reaqctions. Reaction A results in the transfer of 2 mol of electrons per mole of reactant and gener
    14·2 answers
  • For the following gear train, if the blue gear is moving at 50 rpm, what are the speeds of the other gears?
    14·1 answer
  • Intravenous infusions are usually driven by gravity by hanging the bottle at a sufficient height to counteract the blood pressur
    11·1 answer
  • In a photonic material, signal transmission occurs by which of the following? a)- Electrons b)- Photons
    9·1 answer
  • A Carnot engine is operated between two heat reservoirs at temperatures of 520 K and 300 K. It receives heat from the 520 K rese
    8·1 answer
  • WILL MARK BRAINLIST I need help on this asap thanks
    15·1 answer
  • Un material determinado tiene un espesor de 30 cm y una conductividad térmica (K) de 0,04 w/m°C. En un instante dado la distribu
    13·1 answer
  • Jnjn freeeeeeeeeeeeeeeeeeeeeeeeeeeeeee pointtttttttttt
    15·2 answers
  • thanh thẳng AD có kích thước và chịu lực như hình.biết P1 = 10kn, p2=5kn,M=15kn*m,a=2m.Hãy xách định phản lực liên kết tại A,b
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!