65.0k views
1 vote
I was wondering if someone can please help me with this cause I'm kind of stuck on it. The question is: Write a program that will ask the user for a series of words. Then plug them into our paragraph template.

Be careful! The order in which you ask the user for the words matters and needs to match the sample run below. 

Sample Run

Let's play Silly Sentences! Enter a name: Grace Enter an adjective: stinky Enter an adjective: blue Enter an adverb: quietly Enter a food: soup Enter another food: bananas Enter a noun: button Enter a place: Paris Enter a verb: jump Grace was planning a dream vacation to Paris. Grace was especially looking forward to trying the local cuisine, including stinky soup and bananas. Grace will have to practice the language quietly to make it easier to jump with people. Grace has a long list of sights to see, including the button museum and the blue park.

Output Template

Your output should be based on this template:

Let's play Silly Sentences! [name] was planning a dream vacation to [place]. [name] was especially looking forward to trying the local cuisine, including [adjective 1] [food 1] and [food 2]. [name] will have to practice the language [adverb] to make it easier to [verb] with people. [name] has a long list of sights to see, including the [noun] museum and the [adjective 2] park.

Benchmarks

As you work on Assignment 1, you may find it helpful to track your progress against the benchmarks listed below.  Follow the steps in order to ensure that you are writing clear, concise code that will meet all criteria.  Remember that the formatting of your output must be exact - be careful about the spacing and line breaks.

Using the print() function, output, "Let's play Silly Sentences!"  

Using the input() function, prompt the user to, "Enter a name: ", then assign and store their response to a variable.

Repeat benchmark 2 for the other 8 inputs that we need from the user: adjective, adjective, adverb, food, food, noun, place, and verb.

Using a print() function, output, "[name] was planning a dream vacation to [place]." Replace [name] and [place] with the proper variables.

Repeat step 4 with the other 6 lines of output.

Double-check to make sure the output is formatted correctly - including spaces before and after variables and line spacing.

Run and test your program with the values from the Sample Run.

Debug and repeat step 7 as needed.

Hint: Be careful of spaces and typos in your output.




I was wondering if someone can please help me with this cause I'm kind of stuck on-example-1
User Son
by
8.2k points

1 Answer

2 votes

Answer:

Step-by-step explanation:

Certainly! I can help you with that.

To create a program that asks the user for a series of words and plugs them into a paragraph template, you can follow these steps:

1. Use the `print()` function to output the message "Let's play Silly Sentences!"

2. Use the `input()` function to prompt the user to enter a name, and assign the user's response to a variable.

3. Repeat step 2 for the following words in this order: adjective, adjective, adverb, food, food, noun, place, and verb. Assign each user input to a separate variable.

4. Use the `print()` function to output the following sentence, replacing the placeholders with the corresponding variables: "[name] was planning a dream vacation to [place]." Make sure to include proper spacing before and after the variables.

5. Repeat step 4 for the remaining sentences in the paragraph template, replacing the placeholders with the appropriate variables.

6. Double-check the output to ensure it is correctly formatted, including proper spacing and line breaks.

7. Run and test your program with the values provided in the "Sample Run" section.

8. Debug and repeat step 7 as needed to ensure the program functions correctly.

Remember to pay attention to spaces and typos in your output to match the required format.

I hope this helps! Let me know if you have any further questions.

User Tartar
by
7.6k points