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
When is a handrail required for stairs?
Leviafan [203]

Answer:

after 8 stepshddnffuddbnggkbdbkloyr

5 0
3 years ago
Why does voltage have so many names
BARSIC [14]

Answer:

Europe and most other countries in the world use a voltage which is twice that of the US. ... Originally Europe was 120 V too, just like Japan and the US today, but it was deemed necessary to increase voltage to get more power with fewer losses and less voltage drop from the same copper wire diameter

www.worldstandards.eu › electricity › why-no-standard-voltage

Explanation:

6 0
3 years ago
Read 2 more answers
Consider liquid n-hexane in a 50-mm diameter graduated cylinder. Air blows across the top of the cylinder. The distance from the
ra1l [238]

The evaporation rate of the n-Hexane is 7.85 \times 10^{-6} \mathrm{mol} / \mathrm{s}

<u>Explanation</u>:

This is a situation regarding diffusing A through non-diffusing B.

A = n-Hexane B=Air

Where the molar flux is provided by,

N_{A}=D_{A B} P_{T}\left(P_{A 1}-P_{A 2}\right) / R T z P_{b m}

\mathrm{D}_{\mathrm{AB}}=8.8 \times 10^{-6} \mathrm{m}^{2} / \mathrm{s}

P_{t}=1 a t m=101325 P a\\

\text { so, } P_{A 1}= the vapor pressure at hexane 25 \mathrm{C} =20158.2 \mathrm{Pa}

For wind, assume negligible hexane is present, hence P_{A 2}=0

Now,

\mathrm{P}_{\mathrm{B} 1}=\mathrm{P}_{\mathrm{T}}-\mathrm{P}_{\mathrm{A} 1}=101325-20158.2 \mathrm{P}_{\mathrm{a}}

\mathrm{P}_{\mathrm{B} 2}=\mathrm{P}_{\mathrm{T}}-\mathrm{P}_{\mathrm{A} 2}=\mathrm{P}_{\mathrm{T}}=101325 \mathrm{Pa}

P_{B M}=\frac{\left(P_{B 2}-P_{B 1}\right)}{\log _{e}\left(P_{B 2} / P_{B 1}\right)}\\

=\frac{101325-81166.8}{\ln \left(\frac{101325}{81166.8}\right) \mathrm{Pa}}

=90873.57 \mathrm{Pa}

R=8.314 \mathrm{J} / \mathrm{mol}-\mathrm{K}

z=\text { distance }=20 \mathrm{cm}=0.2 \mathrm{m}\\

where T = 298 K

substituting all in the equation, we get

\begin{aligned}&\mathrm{N}_{\mathrm{A}}=\\&\left(8.8 \times 10^{-6} \mathrm{m}^{2} / \mathrm{s}\right) \times 101325 \mathrm{Pa} \times(20158.2 \mathrm{Pa}) /(8.314 \mathrm{J} / \mathrm{mol}-\mathrm{K} \times 0.2 \mathrm{m} \times 298 \mathrm{K}\\&\times 90873.57 \mathrm{Pa})\end{aligned}

=0.004 \mathrm{mol} / \mathrm{m}^{2} \mathrm{s}\\

Now,Flux \times area  = Molar rate of evaporation

Evaporation rate = 0.004 \mathrm{mol} / \mathrm{m}^{2}-5 \mathrm{x}\left(\pi \mathrm{d}^{2} / 4 \mathrm{m}^{2}\right)=0.004 \times(3.14 \times 0.05 \times 0.05 / 4)

Evaporation rate =7.85 \times 10^{-6} \mathrm{mol} / \mathrm{s}

6 0
3 years ago
Can someone make me a chair on onshape DONT be rude I’m sick of wasting my points and getting them back now the points are going
Marizza181 [45]

Answer:

Honestly if you mostly need help are you allowed to ask your peers??? if I struggle there were plenty of kids I would ask and they would help

7 0
3 years ago
The inverted U-tube is used to measure the pressure difference between two points A and B in an inclined pipeline through which
JulijaS [17]

Answer:

i) 0.610 m or 610 mm

ii) 0.4 m or 400 mm

Explanation:

The pressure difference between the pipes is

a) Air

Pa + πha +Ha = Pb + πhb +Hb

Pa - Pb = π(hb-ha) + Hb-Ha

Relative density of air = 1.2754 kg /m3

Pa - Pb = 1.2754 * 0.4 + (0.3-0.2) = 0.610 m or 610 mm

b) paraffin of relative density of 0.75

Pa - Pb = π(hb-ha) + Hb-Ha

Pa - Pb = 0.75 * 0.4 + (0.3-0.2) = 0.4 m or 400 mm

8 0
3 years ago
Other questions:
  • Water at atmospheric pressure boils on the surface of a large horizontal copper tube. The heat flux is 90% of the critical value
    15·1 answer
  • A steam turbine receives 8 kg/s of steam at 9 MPa, 650 C and 60 m/s (pressure, temperature and velocity). It discharges liquid-v
    7·1 answer
  • Given: A graphite-moderated nuclear reactor. Heat is generated uniformly in uranium rods of 0.05m diameter at the rate of 7.5 x
    15·1 answer
  • Convert the following pairs of voltage and current waveforms to phasor form. Each pair of waveforms corresponds to an unknown el
    5·1 answer
  • Which of the following best reflects a shield system?
    6·1 answer
  • Process synchronization can be done on
    15·1 answer
  • 10. In CCS, Northing and Easting are
    15·1 answer
  • hey will you be a friend to my best her name is alexzicancelperez she has only one friend and that me can please be her friend a
    5·2 answers
  • What are some advantages of making electronic components like transistors increasingly smaller? (40 POINTS) Pls help
    9·1 answer
  • Never operate electric tools outdoors or in wet conditions unless circuit is protected by what?.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!