import java.util.Scanner; public class MadLibs { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // Welcome message System.out.println("================================="); System.out.println(" WELCOME TO MAD LIBS CREATOR!"); System.out.println("================================="); System.out.println("Fill in the words to create a silly story!\n"); // Collect words from user System.out.print("Enter a NOUN: "); String noun1 = scanner.nextLine(); System.out.print("Enter a VERB: "); String verb1 = scanner.nextLine(); System.out.print("Enter an ADJECTIVE: "); String adjective1 = scanner.nextLine(); System.out.print("Enter an ADVERB: "); String adverb1 = scanner.nextLine(); System.out.print("Enter a PLACE: "); String place1 = scanner.nextLine(); System.out.print("Enter a NOUN: "); String noun2 = scanner.nextLine(); System.out.print("Enter a VERB ending in -ING: "); String verbIng = scanner.nextLine(); System.out.print("Enter an ADJECTIVE: "); String adjective2 = scanner.nextLine(); System.out.print("Enter a PLURAL NOUN: "); String pluralNoun = scanner.nextLine(); System.out.print("Enter a NUMBER: "); String number = scanner.nextLine(); // Create and display the story System.out.println("\n================================="); System.out.println(" YOUR MAD LIBS STORY"); System.out.println("=================================\n"); System.out.println("Once upon a time, there was a " + adjective1 + " " + noun1 + " who loved to " + verb1 + "."); System.out.println("Every day, they would " + adverb1 + " travel to " + place1 + " to find a magical " + noun2 + "."); System.out.println("One day, while " + verbIng + ", they discovered " + number + " " + adjective2 + " " + pluralNoun + "!"); System.out.println("It was the most amazing adventure ever!\n"); scanner.close(); } } // CHALLENGE IDEAS FOR STUDENTS: // 1. Add more words to make the story longer // 2. Create a different story theme (school, space, sports, etc.) // 3. Add colors, animals, or foods as word categories // 4. Make the program loop so you can create multiple stories // 5. Add error checking to make sure inputs aren't empty