Question: In Java 2) (10 points) Overload the method to draw a histogram and modify it to print based on the percentages contained in a double
In Java
2) (10 points) Overload the method to draw a histogram and modify it to print based on the percentages contained in a double array, you should draw one maker for each 2% range. See the expected output above. public static void drawHistogram(double[] histogramArray, String[] labels) 3) (15 points) Write a method to create an integer histogram based on the letter frequencies of an input string. You should convert the string to lowercase and ignore all punctuation and whitespace. The resulting histogram will have 26 bins (one for each letter). public static int[] createLetterHistogram(String text) * * * * * * * * * 4) (10 points) In your main you should test a letter frequency analysis out on some arbitrary text. (See the example to the right.) This requires createLetterHistogram to generate a histogram a normalizeArray to normalize the letter frequencies Create a label array with each letter in it b drawHistogram to visualize the resulting frequencies d String vText = "Voila! In view, a humble e vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of f Fate. This visage, no mere veneer of vanity, g is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of h a by-gone vexation, stands vivified, and has i * vowed to vanquish these venal and virulent j vermin van-guarding vice and vouchsafing the violently vicious and voracious violation of k volition. The only verdict is vengeance; a 1 * vendetta, held as a votive, not in vain, for the value and veracity of such shall one day m vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it is my very good honor to meet you and you may call me V. And you would be?"; q * * * * * * n * * * O * * 51/15 nainte cinethane r ten von will
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
