Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab GoalThis lab was designed to teach you a great deal more about Array List and to show you to some extent how a Map

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Lab GoalThis lab was designed to teach you a great deal more about Array List and to show you to some extent how a Map works. Lab Description Create a Mad Lib program that reads in lists of nouns, adjectives, and verbs as well as a story and prints out a Mad Lib. Come up with your own Mad Lib to make it more interesting. Sample Data: nouns.dat dog adjectives.dat: blue grcen pig tilding kinny tall unny mad g1ad nappy illy purple place thing truc school ird 11oa tir n:gc tige alephant verbs.dat inh: rank Sample Output: he state clean atter the akinny big place while the stadent ie the state import java.io.File; import java.io.IOException; import java.util.scanner; import java.util.ArrayList; import java.util.collections; import static java.lang.System.*; public class MadLib private ArrayList verbs; private ArrayList nouns; private ArrayList adjectives; public MadLib) public MadLib(String fileName) /load stuff tryt Scanner file new Scanner (new File (fileName)); catch (Exception e) out.println("Houston we have a problem!") public void loadNouns () tryt catch (Exception e) public void loadverbs () tryt catch (Exception e) public void loadNouns try catch (Exception e) public void loadverbs) try catch (Exception e) public void loadAdjectives () try catch (Exception e) public String getRandomVerb() return "" return; return return "ninin" public String getRandomNoun () public string getRandomAdjective) public String tostring) import static java.lang.System.* public class MadLibRunner public static void main( String args) //make a new MadLib out.println(" ") 20 # dog # pig # chicken g run g fly skip & blue & green & orange & fat & skinny & tall # building # car # person # place # thing climb g clean smell The # @ after the @ @ # Gmadlib.dat dog pig chicker building car person place thing truck city state school1 student bird turkey lion tiger alligator elephant nouns.dat* blue green orange fat skinny tall funnv mad glad happy silly purple big little tiny huge 2 adjectives.dat run fly skip clean smell eat crv smile laugh jump crank program erbs.dat* Lab GoalThis lab was designed to teach you a great deal more about Array List and to show you to some extent how a Map works. Lab Description Create a Mad Lib program that reads in lists of nouns, adjectives, and verbs as well as a story and prints out a Mad Lib. Come up with your own Mad Lib to make it more interesting. Sample Data: nouns.dat dog adjectives.dat: blue grcen pig tilding kinny tall unny mad g1ad nappy illy purple place thing truc school ird 11oa tir n:gc tige alephant verbs.dat inh: rank Sample Output: he state clean atter the akinny big place while the stadent ie the state import java.io.File; import java.io.IOException; import java.util.scanner; import java.util.ArrayList; import java.util.collections; import static java.lang.System.*; public class MadLib private ArrayList verbs; private ArrayList nouns; private ArrayList adjectives; public MadLib) public MadLib(String fileName) /load stuff tryt Scanner file new Scanner (new File (fileName)); catch (Exception e) out.println("Houston we have a problem!") public void loadNouns () tryt catch (Exception e) public void loadverbs () tryt catch (Exception e) public void loadNouns try catch (Exception e) public void loadverbs) try catch (Exception e) public void loadAdjectives () try catch (Exception e) public String getRandomVerb() return "" return; return return "ninin" public String getRandomNoun () public string getRandomAdjective) public String tostring) import static java.lang.System.* public class MadLibRunner public static void main( String args) //make a new MadLib out.println(" ") 20 # dog # pig # chicken g run g fly skip & blue & green & orange & fat & skinny & tall # building # car # person # place # thing climb g clean smell The # @ after the @ @ # Gmadlib.dat dog pig chicker building car person place thing truck city state school1 student bird turkey lion tiger alligator elephant nouns.dat* blue green orange fat skinny tall funnv mad glad happy silly purple big little tiny huge 2 adjectives.dat run fly skip clean smell eat crv smile laugh jump crank program erbs.dat*

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions