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
Anne works with other engineers studying physical processes that involve the flow of particles. Which field of engineering would
slega [8]

Answer:

Option A

Chemical engineering

Explanation:

Chemical engineering mainly encompass the study of behavior of different particles such as petroleum, water, drugs and other products. When Anne is involved in a study with engineers who study flow of particles, the flow, viscosity and other properties are among the behavior that chemical engineers are involved in.

3 0
4 years ago
Thin film deposition is a process where: a)-elemental, alloy, or compound thin films are deposited onto a bulk substrate! b)-Pho
marshall27 [118]

Answer:

(A) elemental, alloy, or compound thin films are deposited on to a bulk substrate

Explanation:

In film deposition there is process of depositing of material in form of thin films whose size varies between the nano meters to micrometers onto a surface. The material can be a single element a alloy or a compound.

This technology is very useful in semiconductor industries, in solar panels in CD drives etc

so from above discussion it is clear that option (a) will be the correct answer

8 0
3 years ago
help me please help me please help me please help me please help me please help me please help me please help me please help me
kakasveta [241]

Answer:

With what?

Explanation:

Brainliest?

7 0
3 years ago
Read 2 more answers
When block C is in position xC = 0.8 m, its speed is 1.5 m/s to the right. Find the velocity of block A at this instant. Note th
Amanda [17]

Answer:

The answer is "2 m/s".

Explanation:

The triangle from of the right angle:

\to (x_c-0.8)+(1.5+y_4) +\sqrt{x_c^2 + 1.5^2}= constant

Differentiating the above equation:

\to V_c +V_A+ \frac{X_cV_c}{\sqrt{x_c^2 +1}}=0\\\\\to 1-V_A+ \frac{0.8 \times 1.5}{\sqrt{ 0.8^2+1.5}}=0\\\\

\to V_A=  \frac{1.2}{\sqrt{ 0.64+1.5}}+1\\\\

        = \frac{1.2}{ 1.46}+1\\\\= \frac{1.2+ 1.46}{ 1.46}\\\\ = \frac{2.66}{1.46}\\\\= 1.82 \ \frac{m}{s}\\\\= 2 \ \frac{m}{s}

3 0
3 years ago
At a certain location, wind is blowing steadily at 5 mph. Suppose that the mass density of air is 0.0796 lbm/ft3 and determine t
nlexa [21]

Answer:

The radius of a wind turbine is 691.1 ft

The power generation potential (PGP) scales with speed at the rate of 7.73 kW.s/m

Explanation:

Given;

power generation potential (PGP) = 1000 kW

Wind speed = 5 mph = 2.2352 m/s

Density of air = 0.0796 lbm/ft³ = 1.275 kg/m³

Radius of the wind turbine r = ?

Wind energy per unit mass of air, e = E/m = 0.5 v² = (0.5)(2.2352)²

Wind energy per unit mass of air = 2.517 J/kg

PGP = mass flow rate * energy per unit mass

PGP = ρ*A*V*e

PGP = \rho *\frac{\pi r^2}{2} *V*e  \\\\r^2 = \frac{2*PGP}{\rho*\pi *V*e} , r=\sqrt{ \frac{2*PGP}{\rho*\pi *V*e}} = \sqrt{ \frac{2*10^6}{1.275*\pi *2.235*2.517}}

r = 210.64 m = 691.1 ft

Thus, the radius of a wind turbine is 691.1 ft

PGP = CVᵃ

For best design of wind turbine Betz limit (c) is taken between (0.35 - 0.45)

Let C = 0.4

PGP = Cvᵃ

take log of both sides

ln(PGP) = a*ln(CV)

a = ln(PGP)/ln(CV)

a = ln(1000)/ln(0.4 *2.2352) = 7.73

The power generation potential (PGP) scales with speed at the rate of 7.73 kW.s/m

5 0
3 years ago
Other questions:
  • A rigid tank of 1 in3 contains nitrogen gas at 600 kPa, 400 K. By mistake someone lets 0.5 kg flow out. If the final temperature
    5·1 answer
  • The angle of twist can be computed using the material’s shear modulus if and only if: (a)- The shear stress is still in the elas
    14·1 answer
  • A football player attempts a 30‐yd field goal. If he is able to impart a velocity u of 100 ft/sec to the ball, compute the minim
    6·1 answer
  • Create a separate function file fieldtovar.m that receives a single structure as an input and assigns each of the field values t
    15·1 answer
  • A strain gage is mounted at an angle of 30° with respect to the longitudinal axis of the cylindrical pressure. The pressure vess
    11·1 answer
  • A car is about to start but it blows up. what is the problem with the car<br> ?
    6·2 answers
  • A(n) ____ is an exact representation of an object projected onto a plane from a specific position.
    14·1 answer
  • A proposed embankment fill requires 7100 ft of compacted soil. The void ratio of the compacted fill is specified as 0.5. Four bo
    10·1 answer
  • Cody’s car accelerates from 0m/s to 45 m/s northward in 15 seconds. What is the acceleration of the car
    14·1 answer
  • 8. If you push a 2000 N weight up a ramp with 400 N of force and you raise the weight 1 meter,
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!