C++ How To Program (Early Objects Version), Global Edition, With Access Card, 10 Ed
C++ How To Program (Early Objects Version), Global Edition, With Access Card, 10 Ed
10th Edition
ISBN: 9780134448848
Author: Paul Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 21, Problem 21.17E
Program Plan Intro

Counting Number of Vowels

Program Plan:

  • Include the required header files.
  • Define the “main” function.
    • Create a string object str and accept input in it.
    • Create character array vowel with five vowels.
    • Create integer array freq for frequency and count.
    • Assign count to 0.
    • Transform str to lower case.
    • Use an outer loop to iterate through vowel array.
      • Assign current freq to 0.
      • Traverse through the str.
      • Check if the current value of str is a vowel.
        • If vowel then increment current freq and count.
  • Display the total number of vowels in str.
  • Display the frequency of each vowel using a loop.

Blurred answer
Students have asked these similar questions
Read the following program and answer the questions given at the end.
Which of the following statements are equivalent? Which ones are correctly indented?
State whether each statment is true or false. If the answer is false, explain why? "The address operator & can be applied only to constants and to expressions."
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY