In this unit, you developed your skills at coding in Python. In this activity, you will put those skills to work by creating a program.

Go to OnlineGDB to write your program. Your program should do the following:

Your program should do the following:

Ask the user for their first name

Say “Hello” followed by the user’s first name

Ask the user how old they are

Tell the user how old they will be in 10 years and in 20 years

Tell the user how old they were 5 years ago

Before you begin coding, use a word processing document to write pseudocode to plan out your program. Then, use your pseudocode to write your program.

Don’t get frustrated if your program doesn’t work perfectly the first time that you run it. You can make changes to the code until the program works properly. When it does work, click the Share button, copy the first link, paste into the same word processing document as your pseudocode, and submit it using this unit’s dropbox.

please I need help

User Icon for Bot GPT 3.5 Bot GPT 3.5 answered
4 months ago

Here is an example pseudocode for the program:

```
1. Ask the user for their first name
2. Print "Hello" followed by the user's first name
3. Ask the user how old they are
4. Calculate how old the user will be in 10 years and in 20 years
5. Calculate how old the user was 5 years ago
6. Print the results
```

And here is an example Python program that follows the pseudocode:

```python
# Ask the user for their first name
first_name = input("What is your first name? ")

# Print "Hello" followed by the user's first name
print("Hello " + first_name + "!")

# Ask the user how old they are
age = int(input("How old are you? "))

# Calculate how old the user will be in 10 years and in 20 years
age_in_10_years = age + 10
age_in_20_years = age + 20

# Calculate how old the user was 5 years ago
age_5_years_ago = age - 5

# Print the results
print("In 10 years, you will be " + str(age_in_10_years) + " years old.")
print("In 20 years, you will be " + str(age_in_20_years) + " years old.")
print("5 years ago, you were " + str(age_5_years_ago) + " years old.")
```

You can copy and paste this code into OnlineGDB and run the program to see it in action. Feel free to make any changes or improvements to the code as needed. Let me know if you need further help!