Question: Write a program that solves the classic random writer problem. This problem deals with reading input files of text and examining the frequencies of characters.

Write a program that solves the classic “random writer” problem. This problem deals with reading input files of text and examining the frequencies of characters. On the basis of those frequencies, you can generate randomized output that appears to match the writing style of the original document. The longer the chains you link together, the more accurate the random text will sound. For example, level 4 random text (text with chains of 4 letters long) generated from Tom Sawyer might look like this: “en themself, Mr. Welshman, but him awoke, the balmy shore. I’ll give him that he couple overy because in the slated snufflindeed structure’s kind was rath. She said that the wound the door a fever eyes that WITH him.” Level 10 random text from the same source might look like this: “you understanding that they don’t come around in the cave should get the word beauteous was over-fondled, and that together and decided that he might as we used to do—it’s nobby fun. I’ll learn you.” Search the Internet for “Random Writer” to learn more about this problem, such as the specification posed by computer scientist Joseph Zachary.

Step by Step Solution

3.49 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilRandom class Database private Random generator new Random p... View full answer

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 Building Java Programs A Back to Basics Approach Questions!