In this prelab, you will tackle some of the non-programming issues related to the second full lab assignment. Please write or type up your solutions, and submit it on Gradescope before 10am on Monday. Late prelabs are not accepted.
public int strange(int x){ if (x <= 0){ return 1; } else { return 5 * strange(x-1) - 2; } }
Take a look at the Wikipedia entry for Benford's Law. We are going to compute the frequency distribution of digits in some files and see if this distribution (Benford's law) actually holds for them. As part of this, we will be drawing a simple text-based histogram chart based on the frequency of the digits.
Assuming that you have list of integers representing counts and an integer N representing the height of the tallest bar, give an algorithm that would allow you to come up with an integer height of all the bars such that they are between 0 and N units tall and an appropriate proportion of the height of the tallest bar. Note: the counts might be greater or less than N
For example, if the counts were 1, 2, 4 and N was 20, then you'd make the height of the bar for the count 4 be 20, 2 would be scaled to 10, and 1 would be height 5.
If you adhered to the honor code in this assignment, add the following statement at the top of your prelab.
I have adhered to the Honor Code in this assignment.