Vowels and Consonants Write a function that accepts a pointer to a C-string as its argument. The function should count the number of vowels appearing in the string and return that number. Write another function that accepts a pointer to a C-string as its argument. This func- tion should count the number of consonants appearing in the string and return that number. Demonstrate these two functions in a program that performs the following steps: 1. The user is asked to enter a string. 2. The program displays the following menu: A) Count the number of vowels in the string B) Count the number of consonants in the string C) Count both the vowels and consonants in the string D) Enter another string E) Exit the program 3. The program performs the operation selected by the user and repeats until the user selects E to exit the program.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question

Could you code this for me?

6. Vowels and Consonants
Write a function that accepts a pointer to a C-string as its argument. The function
should count the number of vowels appearing in the string and return that number.
Write another function that accepts a pointer to a C-string as its argument. This func-
tion should count the number of consonants appearing in the string and return that
number.
Demonstrate these two functions in a program that performs the following steps:
1. The user is asked to enter a string.
2. The program displays the following menu:
A) Count the number of vowels in the string
B) Count the number of consonants in the string
C) Count both the vowels and consonants in the string
D) Enter another string
E) Exit the program
3. The program performs the operation selected by the user and repeats until the user
selects E to exit the program.
Transcribed Image Text:6. Vowels and Consonants Write a function that accepts a pointer to a C-string as its argument. The function should count the number of vowels appearing in the string and return that number. Write another function that accepts a pointer to a C-string as its argument. This func- tion should count the number of consonants appearing in the string and return that number. Demonstrate these two functions in a program that performs the following steps: 1. The user is asked to enter a string. 2. The program displays the following menu: A) Count the number of vowels in the string B) Count the number of consonants in the string C) Count both the vowels and consonants in the string D) Enter another string E) Exit the program 3. The program performs the operation selected by the user and repeats until the user selects E to exit the program.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
InputStream
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr