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
Get step-by-step solutions from verified subject matter experts
