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
Look at the data set below.
Goshia [24]
The answer would be 7
3 0
4 years ago
Read 2 more answers
Consider the circuit below where R1 = R4 = 5 Ohms, R2 = R3 = 10 Ohms, Vs1 = 9V, and Vs2 = 6V. Use superposition to solve for the
VladimirAG [237]

Answer:

The value of v2 in each case is:

A) V2=3v for only Vs1

B) V2=2v for only Vs2

C) V2=5v for both Vs1 and Vs2

Explanation:

In the attached graphic we draw the currents in the circuit. If we consider only one of the batteries, we can consider the other shorted.

Also, what the problem asks is the value V2 in each case, where:

V_2=I_2R_2=V_{ab}

If we use superposition, we passivate a battery and consider the circuit affected only by the other battery.

In the first case we can use an equivalent resistance between R2 and R3:

V_{ab}'=I_1'R_{2||3}=I_1'\cdot(\frac{1}{R_2}+\frac{1}{R_3})^{-1}

And

V_{S1}-I_1'R_1-I_1'R_4-I_1'R_{2||3}=0 \rightarrow I_1'=0.6A

V_{ab}'=I_1'R_{2||3}=3V=V_{2}'

In the second case we can use an equivalent resistance between R2 and (R1+R4):

V_{ab}''=I_3'R_{2||1-4}=I_3'\cdot(\frac{1}{R_2}+\frac{1}{R_1+R_4})^{-1}

And

V_{S2}-I_3'R_3-I_3'R_{2||1-4}=0 \rightarrow I_3'=0.4A

V_{ab}''=I_3'R_{2||1-4}=2V

If we consider both batteries:

V_2=I_2R_2=V_{ab}=V_{ab}'+V_{ab}''=5V

7 0
4 years ago
Precast concrete curtain wall panels: Group of answer choices are typically manufactured on site and then hoisted into place. of
amid [387]

Answer:

c) can be made with a variety of surface finishes.

Explanation:

The missing options are;

When it comes to concrete work in construction, the concrete can be cast either in-situ or in form of pre-cast concrete.

Now in-situ concrete means concrete done on the construction site being built while pre cast concrete simply means concrete cast outside in a factory or yard and brought to site to mount.

These pre cast concrete could have different surface finishes as required as this is one of it's advantages over in situ because there is a lot of space and room to have the desired concrete finish.

a) are typically manufactured on site and then hoisted into place.

b) cannot be fiber-reinforced.

c) can be made with a variety of surface finishes.

d) never include insulation.

e) often are unreinforced.

5 0
2 years ago
Is normally a large red cable connected to the battery
Igoryamba

Answer:

yes

Explanation:

its the ground cable

4 0
3 years ago
Read 2 more answers
Sarah is developing a Risk Assessment for her organization. She is asking each department head how long can they be without thei
Natali [406]

Answer:

Sarah is asking each department head how long they can be without their primary system. Sarah is trying to determine the Recovery Time Objective (RTO) as this is the duration of time within which the primary system must be restored after the disruption.

Recovery Point Objective is basically to determine the age of restoration or recovery point.

Business recovery and technical recovery requirements are to assess the requirements to recover by Business or technically.

Hence, Recovery Time Objective (RTO) is the correct answer.

8 0
3 years ago
Other questions:
  • Select the material used to clean a prototype board before soldering.
    5·1 answer
  • A compound machine contains three simple machines with IMAs of 2, 4 and 5, respectively. What is the overall ideal mechanical ad
    15·1 answer
  • B1) 20 pts. The thickness of each of the two sheets to be resistance spot welded is 3.5 mm. It is desired to form a weld nugget
    8·1 answer
  • Reusable refrigerant containers under high-pressure must be hydrostatically tested how often?
    10·1 answer
  • One who is trained in math, science and physics in order to work in a branch of engineering
    7·2 answers
  • The convection heat transfer coefficient for a clothed person standing in moving air is expressed as h 5 14.8V0.69 for 0.15 , V
    12·2 answers
  • O local utilizado pelos grandes avioes para descolar e aterrar
    14·1 answer
  • Multimeter and the LCD is showing Hz. What's she measuring?
    11·1 answer
  • 1. You should
    11·2 answers
  • What is the density of the mass of 24.0g and a volume of 6 ml?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!