Word Counter
Write a program that will count the number of words in a sentence that is entered by the
user, and will keep track of the number of sentences entered. The program should run
similar to the following manner:
-------------------------------------------------------------------
Enter a sentence (press ENTER to end): I am sure I will like VB .Net
There are 8 words in your sentence.
Enter a sentence (press ENTER to end): John12+890’Lane.1SpaceFor4For.
There is 1 word in your sentence.
Enter a sentence (press ENTER to end): My favorite color is white and
there are 6 bedroom in our house. I have only 1 car.
There are 18 words in your sentence.
Enter a sentence (press ENTER to end):
You have entered 3 sentences with a total of 27 words.
Goodbye (press enter to close) ...
-------------------------------------------------------------------
((( Operation )))
user, and will keep track of the number of sentences entered. The program should run
similar to the following manner:
-------------------------------------------------------------------
Enter a sentence (press ENTER to end): I am sure I will like VB .Net
There are 8 words in your sentence.
Enter a sentence (press ENTER to end): John12+890’Lane.1SpaceFor4For.
There is 1 word in your sentence.
Enter a sentence (press ENTER to end): My favorite color is white and
there are 6 bedroom in our house. I have only 1 car.
There are 18 words in your sentence.
Enter a sentence (press ENTER to end):
You have entered 3 sentences with a total of 27 words.
Goodbye (press enter to close) ...
-------------------------------------------------------------------
((( Operation )))
•
The user enters a sentence (or more).
•
The application then displays the total number of words in that sentence, and prompt
again for another sentence.
•
•
When the user press ENTER to end, the program displays the total number of sentences
entered by the user as well as the total number of words.
(((Specifications)))
•
A word is one or more adjacent characters (other than spaces) that are separated by
one or more spaces.
•
•
Trim of the leading the trailing spaces of the text.
•
The number of words should be equal to the number of groups of spaces; that is, a
group of consecutive spaces should be counted as 1.
•
•
The program will keep recording until presses ENTER to end.
, so .. could u make it ???
, so .. could u make it ???