Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class madlibs {
- public static void main(String[] args) {
- String[] nouns = new String[]{"world", "school", "state", "family", "work", "government", "number", "team", "parent", "back"};
- String[] verbs = new String[]{"saw", "took", "found", "gave", "called", "used", "come", "tried", "asked", "made"};
- String[] adjectives = new String []{"historical", "useful", "popular", "able", "mental", "emotional", "scared", "additional", "united", "large"};
- String[] adverbs = new String[]{"faithfully", "exactly", "crazily", "evenly", "eventually", "often", "poorly", "mortally", "rarely", "rapidly"};
- Random rand = new Random ();
- int randNoun = rand.nextInt();
- int randVerb = rand.nextInt();
- int randAdj = rand.nextInt();
- int randAdverb = rand.nextInt();
- System.out.println("Do you" + verbs[randVerb] + "your" + adjectives[randAdj] + nouns[randNoun] + adverbs[randAdverb]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement