Question
Write a program that prompts a user for a sentence. After the sentence is entered have the program print out the following. 1) the sentence
Write a program that prompts a user for a sentence. After the sentence is entered have the program print out the following. 1) the sentence itself, 2) The length of number of characters in the sentence, 3) the number of spaces in the sentence, and 4) Each word in the sentence on a separate line. A word is defined as any group of consecutive characters delimited by one or more spaces. As sample run of the program is: Enter a sentence: This is a sentence with varied spacing. sentence is - This is a sentence with varied spacing. sentence length = 43 There are 10 blanks This is a sentence with varied spacing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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