Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

problem 3 - age in the future ask the user for their name and age. then…

Question

problem 3 - age in the future
ask the user for their name and age. then print out how old they will be in 10 years.
example:
input: sarah
input: 15
output: sarah, in 10 years you will be 25.

Explanation:

Step1: Get user name

Let the user input their name.

Step2: Get user age

Let the user input their age, assume the age is $a$.

Step3: Calculate future age

The age in 10 years is $a + 10$.

Step4: Print result

Print the name and the future - age in the required format.

Answer:

Here is a Python code example to solve this problem:

name = input("Please enter your name: ")
age = int(input("Please enter your age: "))
print(f"{name}, in 10 years you will be {age + 10}.")