Part 1: Pseudocode
- Prompt the user to enter their name and store it in a variable.
- Prompt the user to enter their favorite color and store it in a variable.
- Prompt the user to enter their favorite animal and store it in a variable.
- Prompt the user to enter their favorite food and store it in a variable.
- Concatenate the variables with a story template to create the final story.
- Print the story for the user to read.
Part 2: Code the Program
# Fill-in Story Program
def main():
# Prompt the user for their name and store it in a variable
name = input("Enter your name: ")
# Prompt the user for their favorite color and store it in a variable
color = input("Enter your favorite color: ")
# Prompt the user for their favorite animal and store it in a variable
animal = input("Enter your favorite animal: ")
# Prompt the user for their favorite food and store it in a variable
food = input("Enter your favorite food: ")
# Create the story using concatenation
story = "The " + animal + " is the most beautiful " + color + " creature in the world. " + name + " loves to eat " + food + " and dreams of traveling the world with " + animal + " by their side."
# Print the story
print(story)
if __name__ == "__main__":
main()
Part 3: Post Mortem Review (PMR)
Review Question Response
- The purpose of the program is to create a fill-in story where the user can input their name, favorite color, favorite animal, and favorite food to personalize the story.
- This program could be useful in creating personalized stories for entertainment or as a creative writing tool for children.
- One problem I ran into was not properly using the concatenation operator (+) to join strings in the story. I fixed it by reviewing the code and adding the concatenation operator where needed.
- Next time, I would consider adding more prompts and variables to make the story even more personalized and engaging for the user.