Question: Lab Vowel Program CSCI 111 Programming and Algorithms I NEW CONCEPTS: Successful completion of this lab incorporates the following new concepts. switch statement switch (

Lab

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!