Question: write a S . I.G . ( Shakespearean Insult Generator ) , a program that generates insults using words and phrases that might have been

write a S.I.G.(Shakespearean Insult Generator), a program that generates insults using words and phrases that might have been used by Shakespeare (e.g. Eat my knickers, Thou saucy swag-bellied dewberry!.) Each insult will have four parts: a phrase followed by the word Thou, followed by two adjectives and a noun. Your program will read data from four text files containing the phrase and word lists. Your program will allow the user to continue to use S.I.G. to generate insults until the user tells the program to stop.
Your program must include the following functions:
A function main that controls the program generating insults until the user tells the program to stop.
ONE function that receives a filename and returns a list of phrases from the file (adj1.txt, adj2.txt, nouns.txt, phrases.txt) storing them in one list for each file.
ONE function that receives a list of phrases and randomly selects a phrase from the list to be returned
A function that receives the four phrases and combines the selected phrases for each part of the insult to be printed.
Meaningful comments in the code (including a comment header)
Function that gets the data from a file and returns a list
Function that receives a list of phrases and returns a random phrase from the list
function that receives the four phrases and combines the selected phrases for each part of the insult to be printed
Main function to organize program and calls helper functions with loop.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!