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!
}
}
![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. Youll 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 users 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 (noun!) jumped over (number) [adjectivel) [noun2)s. Then one (noun2) decided to stop belng so
(adjectivel) and take up a hobby: (verbl)ing).
Remember that nouns 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:
Enter a noun: cat
Enter another noun: penguin
Enter an adjective: reasonable
Enter a number greater than 1: 7
Enter a verb: build
The cat jumped over 7 reasonable penguins. Then one penguin
decided to stop being so reasonable and take up a hobby: building.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3ded9074-643d-40d8-825c-f0dff7af7ebf%2Ff1afd3c2-4b38-4184-9eab-529c5e88190b%2F7aon8fg_processed.png&w=3840&q=75)
Transcribed Image Text: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. Youll 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 users 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 (noun!) jumped over (number) [adjectivel) [noun2)s. Then one (noun2) decided to stop belng so
(adjectivel) and take up a hobby: (verbl)ing).
Remember that nouns 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:
Enter a noun: cat
Enter another noun: penguin
Enter an adjective: reasonable
Enter a number greater than 1: 7
Enter a verb: build
The cat jumped over 7 reasonable penguins. Then one penguin
decided to stop being so reasonable and take up a hobby: building.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
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
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
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](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education