In PyCharm, write a program that prompts the user for their name and age. Your program should then tell the user the year they were born. Here is a sample execution of the program with the user input in bold: What is your name? Amanda How old are you? 15 Hello Amanda! You were born in 2005. Write the program. Format your code using best practices. Refer to the zyBooks style guide, if needed, to use proper naming conventions for variables and methods. Use the most appropriate statements with minimal extraneous elements, steps, or procedures. Run the program. Debug the program. Be sure your code produces the correct results. Save and submit your file. This is the work that I have to do, but when I run the code, the only output I get is "What is your name?". Why isn't the rest of the output showing up?

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
icon
Related questions
Question

Part A

In PyCharm, write a program that prompts the user for their name and age. Your program should then tell the user the year they were born. Here is a sample execution of the program with the user input in bold:

What is your name? Amanda How old are you? 15 Hello Amanda! You were born in 2005.

  1. Write the program. Format your code using best practices. Refer to the zyBooks style guide, if needed, to use proper naming conventions for variables and methods. Use the most appropriate statements with minimal extraneous elements, steps, or procedures.
  2. Run the program.
  3. Debug the program. Be sure your code produces the correct results.
  4. Save and submit your file.

This is the work that I have to do, but when I run the code, the only output I get is "What is your name?". Why isn't the rest of the output showing up?

python Project4main.py
Project
Structure
PyCharm File Edit View Navigate Code Refactor Run Tools
— Bookmarks
Project
④ 프로
python Project4 ~/Pycharm Projects/python Project 1
venv
2
3
4
5
6
7
8
> bin
>
lib
.gitignore
pyvenv.cfg
main.py
> III External Libraries
Scratches and Consoles
Services
Ġ = = = Y, M +
Python
Running
main
Palehdet tabbla
LAST SE
I
TODO
9
VCS
JAN
15
Window Help
main.py X
user_name = input("What is your name? ")
# take age of the user as input
user_age = int(input("How old are you? "))
Version Control
Problems > Terminal
Python Packages
Python Console
Services
Debug
Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built Python packages shared indexes // Always download // Download once // Don't... (47 minutes ago
A
python Project4 - main.py
# calculate birth year using required formula
birth_year = (2020 - user_age)
# display the required message
print('Hello' user_name'!''You were born in', birth_year)
O
tv
/Users/thethits3/PycharmProjects/python Project4/venv/bin/python /Users/thethits3/PycharmProjects/python Project4,
What is your name?
A
2
9 ali
7:60
main
W
Sun Jan 15 3:55 PM
A4 A
PC
¤
|
LF UTF-8 4 spaces Python 3.11 (pythonProject4)
ㄒㄧㄝ通
Notifications
Transcribed Image Text:python Project4main.py Project Structure PyCharm File Edit View Navigate Code Refactor Run Tools — Bookmarks Project ④ 프로 python Project4 ~/Pycharm Projects/python Project 1 venv 2 3 4 5 6 7 8 > bin > lib .gitignore pyvenv.cfg main.py > III External Libraries Scratches and Consoles Services Ġ = = = Y, M + Python Running main Palehdet tabbla LAST SE I TODO 9 VCS JAN 15 Window Help main.py X user_name = input("What is your name? ") # take age of the user as input user_age = int(input("How old are you? ")) Version Control Problems > Terminal Python Packages Python Console Services Debug Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built Python packages shared indexes // Always download // Download once // Don't... (47 minutes ago A python Project4 - main.py # calculate birth year using required formula birth_year = (2020 - user_age) # display the required message print('Hello' user_name'!''You were born in', birth_year) O tv /Users/thethits3/PycharmProjects/python Project4/venv/bin/python /Users/thethits3/PycharmProjects/python Project4, What is your name? A 2 9 ali 7:60 main W Sun Jan 15 3:55 PM A4 A PC ¤ | LF UTF-8 4 spaces Python 3.11 (pythonProject4) ㄒㄧㄝ通 Notifications
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

For some reason, The bottom only shows What is your name? I posted the screenshot of my PyCharm screenshot. It doesn't show the rest of the output.

python Project4main.py
Project
Structure
PyCharm File Edit View Navigate Code
— Bookmarks
Project
==
python Project4 ~/Pycharm Projects/python Project 1
venv
2
3
4
5
6
7
8
9
> bin
>
lib
.gitignore
pyvenv.cfg
main.py
> Illi External Libraries
Scratches and Consoles
Services
HYA
Python
Running
main
Refactor Run Tools VCS
palehtibble
TODO
main.py X
Window Help
JAN
15
python Project4 - main.py
#Take username
username = input("What is your name?")
#Take user age in integer form
user_age = int(input("How old are you ?"))
Version Control
Debug
Problems > Terminal
Python Packages
Python Console
Services
Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built Python packages shared indexes // Always download // Download once // Don't ... (today 3:07 PM)
# To get the birth year Just minus the current year user current age
birth_year = (2023 user_age)
#At the end print all the details
print("Hello" + username+" !You were born in "+str(birth_year))
tv
A
2
/Users/thethits3/PycharmProjects/python Project4/venv/bin/python /Users/thethits3/PycharmProjects/python Project4,
What is your name?
9 ali
A
7:34
main
W
Sun Jan 15 4:57 PM
A 3
PC
<
¤
|
LF UTF-8 4 spaces Python 3.11 (python Project4)
ㄒㄧㄝ通
Notifications
M
Transcribed Image Text:python Project4main.py Project Structure PyCharm File Edit View Navigate Code — Bookmarks Project == python Project4 ~/Pycharm Projects/python Project 1 venv 2 3 4 5 6 7 8 9 > bin > lib .gitignore pyvenv.cfg main.py > Illi External Libraries Scratches and Consoles Services HYA Python Running main Refactor Run Tools VCS palehtibble TODO main.py X Window Help JAN 15 python Project4 - main.py #Take username username = input("What is your name?") #Take user age in integer form user_age = int(input("How old are you ?")) Version Control Debug Problems > Terminal Python Packages Python Console Services Download pre-built shared indexes: Reduce the indexing time and CPU load with pre-built Python packages shared indexes // Always download // Download once // Don't ... (today 3:07 PM) # To get the birth year Just minus the current year user current age birth_year = (2023 user_age) #At the end print all the details print("Hello" + username+" !You were born in "+str(birth_year)) tv A 2 /Users/thethits3/PycharmProjects/python Project4/venv/bin/python /Users/thethits3/PycharmProjects/python Project4, What is your name? 9 ali A 7:34 main W Sun Jan 15 4:57 PM A 3 PC < ¤ | LF UTF-8 4 spaces Python 3.11 (python Project4) ㄒㄧㄝ通 Notifications M
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Constants and Variables
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.
Similar questions
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education