Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C ONLY PLEASE Write a program that prompts the user to enter a sentence (assume that a sentence can have a maximum of 50 characters).

C ONLY PLEASE

Write a program that prompts the user to enter a sentence (assume that a sentence can have a maximum of 50 characters). It then counts the vowels and consonants in it. It also calculates the average word length of the input sentence. Word length is the total number of characters in the sentence divided by the total number of words in it. Words are separated by one or more spaces. All the results are displayed at the end. Please follow the given sample input/output. Hint: use fgets instead of scanf.

Sample Input:

Enter a sentence: today is thursday

Output:

Number of vowels in the sentence = 5

Number of consonants in the sentence = 10

Average word length: 5.0

Sample Input:

Enter a sentence: today is thursday

Ouput:

Number of vowels in the sentence = 5

Number of consonants in the sentence = 10

Average word length: 5.0

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

=+ Is secondary industrial action common and/or legal?

Answered: 1 week ago

Question

=+What sanctions are available to employers

Answered: 1 week ago

Question

=+ If strikes occur, are they legally regulated?

Answered: 1 week ago