AVA (for the most part, I don't know how to add random words from the txt. files to the angle brackets. The rest below is the original assignment followed by example)
JAVA (for the most part, I don't know how to add random words from the txt. files to the angle brackets. The rest below is the original assignment followed by example)
This program generates random stories using wordlists you
supply. It starts from a base story that contains place-
holders, which appear in <angle brackets>. The allowed
placeholders are singnoun, plunoun, singverb, pluverb,
pastverb, adj, and adv. The base stories come from files
named story#.txt, where # would be replaced by 1, 2, etc.
Substituting for the placeholders would be words that come
from wordlists. The wordlists must be named noun.txt (for
singular nouns), nouns.txt (for plural nouns), verb.txt
(for singular verbs), verbs.txt (for plural verbs),
verbed.txt (for past-tense verbs), adj.txt (for adjectives)
and adv.txt (for adverbs). All these files - the story files
and the word lists, must be located in the same folder. You
will begin by selecting a story number, and then I'll take
it from there, generating a random story for you to enjoy.
Enter a story number, i to see instructions, or q to quit: 1
Here is your Madlib!
There was once a moist tiger who screamed in a mouse.
Everyone in the peasant was lopsided of the rickety house,
but no one had the locusts to love. So we testily cried
past the dog and praised upon the downtrodden feelings,
and everyone felt dark about their lot in life, until, of course,
the feelings descended upon us like voices and took destiny
from us. Rue that day! Rue it exuberantly.
txt file story
There was once a <adj> <singnoun> who <pastverb> in a <singnoun>.
Everyone in the <singnoun> was <adj> of the <adj> <singnoun>,
but no one had the <plunoun> to <pluverb>. So we <adv> <pastverb>
past the <singnoun> and <pastverb> upon the <adj> <plunoun>,
and everyone felt <adj> about their lot in life, until, of course,
the <plunoun> descended upon us like <plunoun> and took <singnoun>
from us. Rue that day! Rue it <adv>.
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)