Question: For Exercise 5.11, use the same approach that you used in Exercise 5.10 to read strings one character at a time. Adapt function printDistribution on

For Exercise 5.11, use the same approach that you used in Exercise 5.10 to read strings one character at a time. Adapt function printDistribution on p. 108 to print a diagram of word frequencies. Finally, add two optional command-line options to your program. (Optional means that the user may or may not specify them on the command line. Your program should accept them if they are specified.)

The first option, -h, should cause the program to print a usage message. The second option, -s n, where n is a positive integer, should set the threshold for the large strings. All strings with at least n characters should be included in the same category. Let 32 be the default value of n.

Download the script test_string_freq.shFor Exercise 5.11, use the same approach that you used in Exercise to help you test your program.

5.10 to read strings one character at a time. Adapt function printDistributionon p. 108 to print a diagram of word frequencies. Finally, addtwo optional command-line options to your program. (Optional means that the usermay or may not specify them on the command line. Your programshould accept them if they are specified.) The first option, -h, should

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!