Westonci.ca is the best place to get answers to your questions, provided by a community of experienced and knowledgeable experts. Get detailed and precise answers to your questions from a dedicated community of experts on our Q&A platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

To complete this question, you will develop a python program that will determine how many years until retirement and how much is still needed to save.
To complete this program successfully the program must be designed to collect the following inputs from the user:
Full Name
Current Age
Desired Retirement Age
Current Level of Retirement Savings
What Is the Total Amount of Retirements Savings Is Needed at Retirement
Finally, the program will need to output a simple statement (or statements) that show the name, how many years left to retirement and how much needs to be saved to reach your retirement goals.
Input your full name
Input your current age
Input your desired retirement age
Calculate the number of years until retirement age (desired retirement age - current age)
Input your current retirement savings
Input the amount you need to retire
Calculate the amount needed to be saved by retirement age (amount needed to retire - current retirement savings)
Display full name
Display the message "The number of years until retirement age are" number#.
Display the message "The amount needed to be saved by retirement age is" amount#
Stop

Sagot :

The Python Program that gives the desired information is given as follows:

full_name = input("Input your full name: ")

current_age = int(input("Input your current age: "))

desired_retirement_age = int(input("Input your desired retirement age: "))

current_savings = float(input("Input your current retirement savings: "))

total_savings_needed = float(input("Input the total amount of retirement savings needed at retirement: "))

years_until_retirement = desired_retirement_age - current_age

amount_needed_to_save = total_savings_needed - current_savings

print(f"{full_name}, the number of years until retirement age are {years_until_retirement}.")

print(f"The amount needed to be saved by retirement age is {amount_needed_to_save:.2f}.")

This is the entire code that is needed to build the program.

How to construct the Python program?

The first step in constructing the Python program is reading the variables, as follows:

full_name = input("Input your full name: ")

current_age = int(input("Input your current age: "))

desired_retirement_age = int(input("Input your desired retirement age: "))

current_savings = float(input("Input your current retirement savings: "))

total_savings_needed = float(input("Input the total amount of retirement savings needed at retirement: "))

The variables are read using the input command. Strings, which is the variable type of full_name, does not need casting, and the casting of the numeric variables is given as follows:

  • int: integer values.
  • float: decimal values.

Then the number of years needed, and the amount needed to save, are calculated as follows:

years_until_retirement = desired_retirement_age - current_age

amount_needed_to_save = total_savings_needed - current_savings

Finally, the output of the statement is given as follows:

print(f"{full_name}, the number of years until retirement age are {years_until_retirement}.")

print(f"The amount needed to be saved by retirement age is {amount_needed_to_save:.2f}.")

The .2f clause means that the decimal amount is rounded to two decimal places.

More can by learned about Python programming at https://brainly.com/question/26497128

#SPJ1

Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. Thank you for using Westonci.ca. Come back for more in-depth answers to all your queries.