If you've never played with mad libs before, you're in for a treat. What is a mad lib, you might ask? It's an interactive story that lets you, the user, choose a bunch of words, which are then inserted into a story, making for a hilariously nonsensical piece of art. You'll be programming a simple version of a mad libs program here. To make a mad libs game, you have to do a few things: 1. Write a generic story 2 Take out specific words from that story 3. Ask the user for specific parts of speech (that correspond to the removed words) 4. Re-tell the story with the user's inputted words. For the sake of simplicity. let's use a short story that's two sentences long. Please use this exact story, including the period at the end of the second sentence! • The (nounl) jumped over (number) (adjectivel) (noun2)s. Then one (noun2) decided to stop being so (adjectivel) and take up a hobby: (verbl]ing). Remember that noung are words that name things, adjectives are words that modify nouns, and verbs are action words. What you need to do: create a program In Madlib.java. It should: • Prompt the user for a noun: "Enter a noun: • Prompt the user for another noun: "Enter another noun: • Prompt the user for an adjective: "Enter an adjective:" • Prompt the user for a number: "Enter a number greater than 1: " • Prompt the user for a verb: "Enter a verb:" • Then print the madlib story with the appropriate words replaced. Example Input and output from running the program:
If you've never played with mad libs before, you're in for a treat. What is a mad lib, you might ask? It's an interactive story that lets you, the user, choose a bunch of words, which are then inserted into a story, making for a hilariously nonsensical piece of art. You'll be programming a simple version of a mad libs program here. To make a mad libs game, you have to do a few things: 1. Write a generic story 2 Take out specific words from that story 3. Ask the user for specific parts of speech (that correspond to the removed words) 4. Re-tell the story with the user's inputted words. For the sake of simplicity. let's use a short story that's two sentences long. Please use this exact story, including the period at the end of the second sentence! • The (nounl) jumped over (number) (adjectivel) (noun2)s. Then one (noun2) decided to stop being so (adjectivel) and take up a hobby: (verbl]ing). Remember that noung are words that name things, adjectives are words that modify nouns, and verbs are action words. What you need to do: create a program In Madlib.java. It should: • Prompt the user for a noun: "Enter a noun: • Prompt the user for another noun: "Enter another noun: • Prompt the user for an adjective: "Enter an adjective:" • Prompt the user for a number: "Enter a number greater than 1: " • Prompt the user for a verb: "Enter a verb:" • Then print the madlib story with the appropriate words replaced. Example Input and output from running the program:
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Java - Please do following way. (Don't use scanner)
import acm.program.*;
public class Madlib extends CommandLineProgram
{
public void run()
{
// Your code here!
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education