Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 13 Vowel Program CSCI 111 Programming and Algorithms I NEW CONCEPTS: Successful completion of this lab incorporates the following new concepts. switch statement switch
Lab 13 Vowel Program CSCI 111 Programming and Algorithms I NEW CONCEPTS: Successful completion of this lab incorporates the following new concepts. switch statement switch ( ) { case 'x': statement; break; case 'y': statement; break; BLAH default: statement; } tolower function #include locale loc; tolower( , loc) Task list: 1. Create a source code file named lab13.cpp. 2. Start by prompting the user for a sentence and saving it into a variable of type string. 3. Determine the frequency of each of the 5 vowels (i.e. a, e, i, o, u) plus other unknown characters. 4. The determination of vowels should be case-insensitive which means lower and upper-case letters are treated the same. It is mandatory to use the tolower function. Using the or statement can produce the same result, but 0 credit will be earned. locale loc; tolower(sentence[c],loc)) { 5. The program should also use the switch statement. Again, 0 credit will be earned without the implementation of the switch statement. 6. Refer to the expected output listing below. SAMPLE OUTPUT Please enter a sentence. CSCI 111 is fun and ENJOYABLE! Vowel statistics a: 2 e: 2 i: 2 o: 1 u: 1 unknown: 22
Lab 13
Vowel Program
CSCI 111 Programming and Algorithms I
NEW CONCEPTS: Successful completion of this lab incorporates the following new concepts.
switch statement
switch ( )
{
case 'x':
statement;
break; case 'y':
statement; break;
BLAH
default: statement;
}
tolower function
#include
locale loc;
tolower( , loc)
Task list:
1. Create a source code file named lab13.cpp.
2. Start by prompting the user for a sentence and saving it into a variable of type string.
3. Determine the frequency of each of the 5 vowels (i.e. a, e, i, o, u) plus other unknown characters.
4. The determination of vowels should be case-insensitive which means lower and upper-case letters are
treated the same. It is mandatory to use the tolower function. Using the or statement can produce the same result, but 0 credit will be earned.
locale loc;
tolower(sentence[c],loc))
{
5. The program should also use the switch statement. Again, 0 credit will be earned without the
implementation of the switch statement.
6. Refer to the expected output listing below.
SAMPLE OUTPUT
Please enter a sentence.
CSCI 111 is fun and ENJOYABLE!
Vowel statistics
a: 2
e: 2
i: 2
o: 1
u: 1
unknown: 22
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started