Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculates the average word length of a sentence. Your program should start by asking the user for a sentence. Then it

Write a program that calculates the average word length of a sentence.

Your program should start by asking the user for a sentence. Then it should calculate the average word length of the sentence. Your program should consider punctuation as part of the word to which it is attached. The output should be displayed to one decimal place.

Hints: For this program youll need a loop, inside of which there should be 2 or 3 IF/ELSE IF statements. You should also use the following functions:

getchar(): Pulls the next character from the CIN input buffer for analysis. An example can be found on tutorialspoint.com (link below).

Must use #include at the top of your program.

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

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions