Question: Write a function bracket_by_len() that takes a word as an input argument and returns the word bracketed to indicate its length. Words less than five
Write a function bracket_by_len() that takes a word as an input argument and returns the word bracketed to indicate its length. Words less than five characters long are bracketed with << >> , words five to ten letters long are bracketed with (* *) , and words over ten characters long are bracketed with /+ +/ .
Your program should require the calling function to provide three arguments. The first argument is used as an output parameter to return the resulting string, the second argument is the string input entered by the user, and the third parameter is the maximum size allowed for the result.
For example: bracket_by_len(tmp, "insufficiently", 20) results in this string --> "/+insufficiently+/"
bracket_by_len(tmp, "the", 20) results in this string --> "<>"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
