Write a program titled YourLastName_MadLibs that prompts the user for input with respect to a Mad Lib game read from a file. The first line of the input file will contain the number of times to ask the user for input (n). The next n lines of the input file will contain a description of what kind of word to prompt the user for, a noun, adjective, verb, etc On each separate line thereafter, for the rest of the file, the story that will be created by the Mad Lib is contained.The program should do the following: read the file and determine how many times to prompt the user for input, prompt the user for a word using the description from the file, write the users answer to a separate text file, and then write the result of the Mad Lib to the console using the story from the input file and the users answers from the separate text file.For example:The following shows an example interaction captured in a file by the command % script MadLibs.out (bolded areas represent the users input):Script started on Fri Sep 20 11:13:28 2013% java Diaz_MadLibsEnter a file name:Mad Libs 1.txtPlease provide a word for each of the following:Name of person in room:Aaron RodgersSame name of person in room:Aaron RodgersVerb ending in ing:smellingVerb:skipNoun (plural):platesSame name of person in room:Aaron RodgersAdjective:hairyAdjective:lazyNoun (plural):moonsPlace:Las VegasSame name of person in room:Aaron RodgersVerb ending in ed:hailedEmotion:sadnessAdverb:lonelyAdjective:fuzzyNoun (plural):napkinsSame name of person in room:Aaron RodgersNoun:phoneBatman is Aaron Rodgers. Teenager Aaron Rodgers was traumatized by smelling his parent`s murder and vowed to skip their deaths by bringing the plates to justice. Aaron Rodgers used his hairy fortune to study criminology, to train his body to lazy perfection, and to acquire high tech vehicles and moons to fight crime in his hometown of Las Vegas. One night Aaron Rodgers was hailed by a bat outside his window and decided to dress himself as a bat man to strike sadness in the lonely and fuzzy hearts of napkins. From that moment forward, Aaron Rodgers became Batman in his altered phone.% exitscript done on Fri Sep 20 11:15:08 2013Run the program three times with different input and capture all interaction in a file using the script command.What to turn in: Soft copy of the results using the script command Soft copy of the program(s) (the .java file(s) submitted to Blackboard
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.