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.sh to help you test your program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started