Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task list: 1. Create a source code file named lab14.cpp. 2. The goal of this program is to prompt the user for 3 sentences. For

Task list:

1. Create a source code file named lab14.cpp.

2. The goal of this program is to prompt the user for 3 sentences. For each sentence, calculate the frequency of each vowel as done in Lab 13. Store variable counters for each sentence. Store both the letter and its frequency.

3. After performing step 2 for all 3 sentences, determine which sentence has the most occurrences of a vowel and display the complete results as shown below.

4. It is OK to assume that there is never a tie of the most popular letter for each sentence. This will save much time. Hint: So, ensure your test data follows this rule.

5. Refer to the expected output listing below.

SAMPLE OUTPUT:

Enter sentence 0. I just wAnt to BANG on the drum all day LONG.

Vowel statistics

a: 4

e: 1

i: 1

o: 3

u: 2

unknown: 34

The most popular letter for sentence 0 is >a< having 4 occurrences.

Enter sentence 1.

The teacher told ME to stay after school.

Vowel statistics

a: 3

e: 5

i: 0

o: 4

u: 0

unknown: 29

The most popular letter for sentence 1 is >e< having 5 occurrences.

Enter sentence 2.

The BOSS is a jerk.

Vowel statistics

a: 1

e: 2

i: 1

o: 1

u: 0

unknown: 14

The most popular letter for sentence 2 is >e< having 2 occurrences.

The sentence with the most popular vowel is sentence 1 having 5 occurrences of letter >>e<<.

Enter sentence 0. I know it always sounds ABSURD.

Vowel statistics

a: 3

e: 0

i: 2

o: 2

u: 2

unknown: 22

The most popular letter for sentence 0 is >a< having 3 occurrences.

Enter sentence 1.

I TELL you once more before I get up and go.

Vowel statistics

a: 1

e: 6

i: 2

o: 5

u: 2

unknown: 28

The most popular letter for sentence 1 is >e< having 6 occurrences.

Enter sentence 2.

One OF these days you WILL get it right.

Vowel statistics

a: 1

e: 4

i: 3

o: 3

u: 1

unknown: 28

The most popular letter for sentence 2 is >e< having 4 occurrences.

The sentence with the most popular vowel is sentence 1 having 6 occurrences of letter >>e<<.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

What is the difference between equity funding and debt financing?

Answered: 1 week ago