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
An iron-carbon alloy initially containing 0.286 wt% C is exposed to an oxygen-rich and virtually carbon-free atmosphere at 1200°
Fantom [35]

Answer:

Explanation:

Given data:

initial construction co = 0.286 wt %

concentration at surface position cs = 0 wt %

carbon concentration cx = 0.215 wt%

time = 7 hr

D =  7.5 \times 10^{-11} m^2/s

for 0.225% carbon concentration following formula is used

\frac{cx -co}{cs -co} = 1 - erf(\frac{x}{2\sqrt{DT}})

where, erf stand for error function

\frac{cx -co}{cs -co} = \frac{0.215 -0.286}{0 -0.286} =0.248

0.248 = 1 - erf(\frac{x}{2\sqrt{DT}})

erf(\frac{x}{2\sqrt{DT}}) = 1 - 0.248

erf(\frac{x}{2\sqrt{DT}}) = 0.751

from the table erf(Z) value = 0.751 lie between (z) = 0.80 and z = 0.85 so by inteerpolation we have z = 0.815

from given table

\frac{x}{2\sqrt{DT}} = 0.815

x = 2\times 0.815 \times \sqrt{7.5 \times 10^{-11}\times (7\times 3600)

x = 2.39\times 10^{-3} m

x = 0.002395 mm

8 0
3 years ago
What is the term RF exiciter?
Sati [7]
The exciter provides fully coherent receiver local oscillator signals at radar frequency band as well as requisite, auxiliary high frequency clock signals. The exciter function is divided into an internal frequency synthesizer and an upconverter.

Hope this helps :)))
7 0
2 years ago
A cylinder fitted with a frictionless piston contains 2 kg of R-134a at 3.5 bar and 100 C. The cylinder is now cooled so that th
inna [77]

Answer:

The answer to the question is

The heat transferred in the process is -274.645 kJ

Explanation:

To solve the question, we list out the variables thus

R-134a = Tetrafluoroethane

Intitial Temperaturte t₁ = 100 °C

Initial pressure = 3.5 bar = 350 kPa

For closed system we have m₁ = m₂ = m

ΔU = m×(u₂ - u₁) = ₁Q₂ -₁W₂

For constant pressure process we have

Work done = W = \int\limits^a_b P \, dV  = P×ΔV = P × (V₂ - V₁) = P×m×(v₂ - v₁)

From the tables we have

State 1 we have h₁ = (490.48 +489.52)/2 = 490 kJ/kg

State 2 gives h₂ = 206.75 + 0.75 × 194.57= 352.6775 kJ/kg

Therefore Q₁₂ = m×(u₂ - u₁) + W₁₂ = m × (u₂ - u₁) + P×m×(v₂ - v₁)

= m×(h₂ - h₁) = 2.0 kg × (352.6775 kJ/kg - 490 kJ/kg) =-274.645 kJ

5 0
3 years ago
How is the fuel introduced into the Diesel engine?
Ugo [173]

Answer:

diesel fuel is pumped at high pressure to the injectors which are responsible for entering the fuel into the combustion chamber,

when the piston is at the top the pressure is so high that it explodes the fuel (diesel) that results in a generation of mechanical power

5 0
3 years ago
Relay contacts that are defined as being normally open (n.o.) have contacts that are:_____.
Reptile [31]

Relay contacts that are defined as being normally open (n.o.) have contacts that are open only if  the relay coil is known to have de-energized.

<h3>What is meant by normally open contacts?</h3>

Normally open (NO) are  known to be open if there is no measure of current that is flowing through a given coil but it often close as soon as the coil is said to be energized.

Note that  Normally closed (NO) contacts are said to be closed only if the coil is said to be de-energized and open only if the coil is said to carry current or is known to have energized.

The role of relay contact is wide. The Relays are tools that are often used in the work of  switching of control circuits and it is one that  a person cannot used for power switching that has relatively bigger ampacity.

Therefore, Relay contacts that are defined as being normally open (n.o.) have contacts that are open only if  the relay coil is known to have de-energized.

Learn more about Relay contacts from

brainly.com/question/15334861
#SPJ1

8 0
1 year ago
Other questions:
  • Estudio de caso Teorema de Bayes. Las historias de casos clínicos indican que diversas enfermedades producen sistemas similares.
    14·1 answer
  • Which sentence about the technology design process is true
    12·1 answer
  • Determine the Thevenin/Norton Equivalent Circuit with respect to the terminalsa,bas shown in the figure. (Here 1A is an independ
    11·1 answer
  • Rosalind franklin<br> What was she famous for
    14·1 answer
  • In Engineering, what is a shoulder on a bridge?
    8·1 answer
  • Write a matrix, that is a lower triangular matrix.
    15·1 answer
  • Today I meant to look for my missing watch, but I could never find the time.
    9·2 answers
  • Can someone please help me this is urgent!?
    12·2 answers
  • Which of the following is not a function of the suspension system?_____
    6·1 answer
  • What is the sun's degree angle in the sky in summer and in winter?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!