Write a program that asks the user to enter his name and age and prints on...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that asks the user to enter his name and age and prints on the screen the year in which he was born and when he will be doubled in age. Sample Run: Enter your name: Sami Hi Sami, what is your age? 21 You were born in 2001 and you will have 42 years old on 2043 Write a program that asks the user to enter his name and age and prints on the screen the year in which he was born and when he will be doubled in age. Sample Run: Enter your name: Sami Hi Sami, what is your age? 21 You were born in 2001 and you will have 42 years old on 2043
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that achieves the desired functionality Python def calculatebirthanddoubleagename age This function takes a name and age as input and calculates the birth year and year when the person will be double their age Args name The users name as a string age The users age as an integer bornyear 2024 age doubleageyear bornyear 2 age printfHi name you were born in bornyear and you will be doubled in age on doubleageyear Get user input name inputEnter your name age intinputHi what is your age formatname Call the function to calculate and print results calculatebirthanddoubleagename age Explanation Function definition The code defines a function calculatebirthanddoubleage ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Alpha Company used the periodic inventory system for purchase & sales of merchandise. Discount terms for both purchase & sales are, FOB Destination, 2/10, n30 and the gross method is used. > Alpha...
-
Sweeten Company had no jobs in progress at the beginning of the year and no beginning inventories. It started, completed, and sold only two jobs during the year-Job P and Job Q. The company uses a...
-
It is clear that Jaguar practices responsibility toward the environment. Using your knowledge gained from this Jaguar case study and further research, provide five (5) examples of how Jaguar is...
-
The balance sheet is the cornerstone of the financial statements. The SEC has always wanted and expected more information and disclosure in the financial statements. Starting with the balance sheet,...
-
How would the balance sheet of a life insurance company change if it offered to run a private pension fund for another company?
-
In Problem 2.4 you were asked to compute a $95 %$ CI on mean gasoline prediction interval on mileage when the engine displacement $x_{1}=275$ in. $^{3}$ Compare the lengths of these intervals to the...
-
To the right is a list of domestic output and national income figures for a certain year. All figures are in billions. The questions that follow ask you to determine the major national income...
-
For each of the following, compute the future value: Interest Present Value Years Future Value Rate $2,250 11 10% ? 8,752 7 8% ? 76,355 14 17% ? 183,796 8 7% ?
-
There is a rectangular foundation, foundation soil stratification, self-weight stress and additional stress calculation results are shown below (stress in kPa), foundation soil compression test...
-
Explain the difficulty in calculating the discount rate that should be applied to an options payoff in the real world.
-
Classify the following items into liabilities and assets: (a) Computers (b) Buildings (c) Accounts payable for inventory (d) Inventory (e) Accounts receivable (f) Cash in bank (g) Bank overdraft (h)...
-
What are the properties of geometric Brownian motion?
-
What problem does It's lemma solve?
-
What is the difference between a warrant to purchase a stock and an exchange-traded stock option?
-
Fortune Drilling Company acquires a mineral deposit at a cost of $5,900,000. It incurs additional costs of $600,000 to access the deposit, which is estimated to contain 2,000,000 tons and is expected...
-
Using the information presented in Problem 13.4B, prepare a partial statement of cash flows for the current year, showing the computation of net cash flows from operating activities using the...
-
What is a count-controlled loop?
-
The showinfo function is in this module. a. Tkinter b. Tkinfo c. Sys d. Tkinter.messagebox
-
What function do you call to retrieve and unpickle an object?
-
Professor Ray C. Fair's voting model was introduced in Exercise 2.23. He builds models that explain and predict the U.S. presidential elections. See his website at...
-
In the STAR experiment (Section 7.5.3), children were randomly assigned within schools into three types of classes: small classes with 13-17 students, regular-sized classes with 22-25 students, and...
-
Many cities in California have passed Inclusionary Zoning policies (also known as below-market housing mandates) as an attempt to make housing more affordable. These policies require developers to...
Study smarter with the SolutionInn App