(b) Write a program that takes a string from the user and calculates the number of vowels, consonants, digits and white-spaces.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 1PP: (Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard...
icon
Related questions
Question
Please answer it in c++ 4b
QUESTION 4
(a) Write a program that computes the average of numbers using arrays.
The program should caleulate the average of the number of data fronl to 100.
If the user enters a value of n which is above 100 or below 100 then the while
loop should be executed to request the user to reenter value of n until it is
between I and 100.
• When the numbers are entered by the user, subscquently the sum should be
calculated and stored in the variable sum.
• After storing all the numbers, average should be calculated and displayed.
The program should take n number of elements from user (where, n is
specified by user), stores data in an array and calculates the average of those
numbers.
(b) Write a program that takes a string from the user and calculates the number of
vowels, consonants, digits and white-spaces.
Transcribed Image Text:QUESTION 4 (a) Write a program that computes the average of numbers using arrays. The program should caleulate the average of the number of data fronl to 100. If the user enters a value of n which is above 100 or below 100 then the while loop should be executed to request the user to reenter value of n until it is between I and 100. • When the numbers are entered by the user, subscquently the sum should be calculated and stored in the variable sum. • After storing all the numbers, average should be calculated and displayed. The program should take n number of elements from user (where, n is specified by user), stores data in an array and calculates the average of those numbers. (b) Write a program that takes a string from the user and calculates the number of vowels, consonants, digits and white-spaces.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,