Sentence Analyzer – Nursing Writings
Sentence Analyzer – Nursing Writings
Write a program that counts number of words in a sentence and displays the average number of letters in each word. Your program should ask the user to type a sentence(or sentences) that are 80 characters or less. If the sentence is longer than 80 characters, truncate it and notify the user of your action.Your program should call:
A function that accepts a string class object as its argument and returns the number of words contained in the string. For example, if the string argument is “Fourscore and seven years ago” the function should return the number 6.A function that accepts a string class object as its argument and returns the number of punctuation characters (period, comma, exclamation, etc.) in thesentence(s).A function that accepts a string class object as its argument and returns the average number of letters in each word.
Your program should present the user with the following menu:A. Count number of words in the sentenceB. Count number of punctuations in the sentenceC. Compute the average number of letters in each wordD. Enter another sentenceE. Exit
The program should exit when the user selects “E” to exit the program. Pass data to your functions by value, by reference, and use static variables if necessary.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..
